0

Rename initial_pos to initial_rect in ShowWidget and ShowView IPCs.

These IPCs hold this param as a gfx::Rect and the RenderWidget and RenderView
set the size. On the receiving end, the size is sometimes used so initial_pos
was a misnomer.

This is a mechanical rename, there should be no functional difference.

TBR=
BUG=

Review URL: https://codereview.chromium.org/889403004

Cr-Commit-Position: refs/heads/master@{#314430}
This commit is contained in:
bokan
2015-02-03 15:23:39 -08:00
committed by Commit bot
parent 8da6aa6d5f
commit 107a47faa8
72 changed files with 132 additions and 131 deletions
android_webview/native
apps
chrome/browser
chromecast/browser/android
content
extensions
ui

@ -125,7 +125,7 @@ void AwWebContentsDelegate::RunFileChooser(WebContents* web_contents,
void AwWebContentsDelegate::AddNewContents(WebContents* source,
WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
JNIEnv* env = AttachCurrentThread();

@ -37,7 +37,7 @@ class AwWebContentsDelegate
virtual void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;

@ -71,13 +71,13 @@ void CustomLauncherPageContents::AddNewContents(
content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
app_delegate_->AddNewContents(new_contents->GetBrowserContext(),
new_contents,
disposition,
initial_pos,
initial_rect,
user_gesture,
was_blocked);
}

@ -48,7 +48,7 @@ class CustomLauncherPageContents
void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
bool IsPopupOrPanel(const content::WebContents* source) const override;

@ -308,7 +308,7 @@ void ChromeWebContentsDelegateAndroid::AddNewContents(
WebContents* source,
WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
// No code for this yet.

@ -84,7 +84,7 @@ class ChromeWebContentsDelegateAndroid
virtual void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
private:

@ -118,11 +118,11 @@ void BackgroundContents::DidNavigateMainFramePostCommit(WebContents* tab) {
void BackgroundContents::AddNewContents(WebContents* source,
WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
delegate_->AddWebContents(
new_contents, disposition, initial_pos, user_gesture, was_blocked);
new_contents, disposition, initial_rect, user_gesture, was_blocked);
}
bool BackgroundContents::IsNeverVisible(content::WebContents* web_contents) {

@ -36,7 +36,7 @@ class BackgroundContents : public content::WebContentsDelegate,
// set to true if the popup gets blocked, and left unchanged otherwise.
virtual void AddWebContents(content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) = 0;
@ -63,7 +63,7 @@ class BackgroundContents : public content::WebContentsDelegate,
void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
bool IsNeverVisible(content::WebContents* web_contents) override;

@ -767,7 +767,7 @@ const base::string16& BackgroundContentsService::GetParentApplicationId(
void BackgroundContentsService::AddWebContents(
WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
Browser* browser = chrome::FindLastActiveWithProfile(
@ -775,6 +775,6 @@ void BackgroundContentsService::AddWebContents(
chrome::GetActiveDesktop());
if (browser) {
chrome::AddWebContents(browser, NULL, new_contents, disposition,
initial_pos, user_gesture, was_blocked);
initial_rect, user_gesture, was_blocked);
}
}

@ -91,7 +91,7 @@ class BackgroundContentsService : private content::NotificationObserver,
// BackgroundContents::Delegate implementation.
void AddWebContents(content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;

@ -828,7 +828,7 @@ void DevToolsWindow::ActivateContents(WebContents* contents) {
void DevToolsWindow::AddNewContents(WebContents* source,
WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
if (new_contents == toolbox_web_contents_) {
@ -848,7 +848,7 @@ void DevToolsWindow::AddNewContents(WebContents* source,
WebContents* inspected_web_contents = GetInspectedWebContents();
if (inspected_web_contents) {
inspected_web_contents->GetDelegate()->AddNewContents(
source, new_contents, disposition, initial_pos, user_gesture,
source, new_contents, disposition, initial_rect, user_gesture,
was_blocked);
}
}

@ -233,7 +233,7 @@ class DevToolsWindow : public DevToolsUIBindings::Delegate,
void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
void WebContentsCreated(content::WebContents* source_contents,

@ -41,10 +41,10 @@ ChromeExtensionHostDelegate::GetJavaScriptDialogManager() {
void ChromeExtensionHostDelegate::CreateTab(content::WebContents* web_contents,
const std::string& extension_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) {
ExtensionTabUtil::CreateTab(
web_contents, extension_id, disposition, initial_pos, user_gesture);
web_contents, extension_id, disposition, initial_rect, user_gesture);
}
void ChromeExtensionHostDelegate::ProcessMediaAccessRequest(

@ -22,7 +22,7 @@ class ChromeExtensionHostDelegate : public ExtensionHostDelegate {
void CreateTab(content::WebContents* web_contents,
const std::string& extension_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) override;
void ProcessMediaAccessRequest(content::WebContents* web_contents,
const content::MediaStreamRequest& request,

@ -171,7 +171,7 @@ base::DictionaryValue* ExtensionTabUtil::OpenTab(
GURL url;
if (params.url.get()) {
std::string url_string= *params.url;
std::string url_string = *params.url;
url = ExtensionTabUtil::ResolvePossiblyRelativeURL(url_string,
function->extension());
if (!url.is_valid()) {
@ -528,7 +528,7 @@ bool ExtensionTabUtil::IsCrashURL(const GURL& url) {
void ExtensionTabUtil::CreateTab(WebContents* web_contents,
const std::string& extension_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) {
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
@ -548,7 +548,7 @@ void ExtensionTabUtil::CreateTab(WebContents* web_contents,
params.extension_app_id = extension_id;
params.disposition = disposition;
params.window_bounds = initial_pos;
params.window_bounds = initial_rect;
params.window_action = chrome::NavigateParams::SHOW_WINDOW;
params.user_gesture = user_gesture;
chrome::Navigate(&params);

@ -161,7 +161,7 @@ class ExtensionTabUtil {
static void CreateTab(content::WebContents* web_contents,
const std::string& extension_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture);
// Executes the specified callback for all tabs in all browser windows.

@ -219,7 +219,7 @@ content::WebContents* ChromeAppDelegate::OpenURLFromTab(
void ChromeAppDelegate::AddNewContents(content::BrowserContext* context,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
if (!disable_external_open_for_testing_) {
@ -240,7 +240,7 @@ void ChromeAppDelegate::AddNewContents(content::BrowserContext* context,
NULL,
new_contents,
disposition,
initial_pos,
initial_rect,
user_gesture,
was_blocked);
}

@ -40,7 +40,7 @@ class ChromeAppDelegate : public extensions::AppDelegate,
void AddNewContents(content::BrowserContext* context,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
content::ColorChooser* ShowColorChooser(content::WebContents* web_contents,

@ -89,12 +89,12 @@ void AutofillDialogSignInDelegate::AddNewContents(
content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
chrome::AddWebContents(
chrome::FindBrowserWithWebContents(originating_web_contents_),
source, new_contents, disposition, initial_pos, user_gesture,
source, new_contents, disposition, initial_rect, user_gesture,
was_blocked);
}

@ -38,7 +38,7 @@ class AutofillDialogSignInDelegate: public content::WebContentsDelegate,
void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
bool PreHandleGestureEvent(content::WebContents* source,

@ -1391,10 +1391,10 @@ void Browser::VisibleSSLStateChanged(const WebContents* source) {
void Browser::AddNewContents(WebContents* source,
WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
chrome::AddWebContents(this, source, new_contents, disposition, initial_pos,
chrome::AddWebContents(this, source, new_contents, disposition, initial_rect,
user_gesture, was_blocked);
}

@ -548,7 +548,7 @@ class Browser : public TabStripModelObserver,
void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
void ActivateContents(content::WebContents* contents) override;

@ -48,7 +48,7 @@ void AddWebContents(Browser* browser,
content::WebContents* source_contents,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
// No code for this yet.
@ -59,7 +59,7 @@ void AddWebContents(Browser* browser,
NavigateParams params(browser, new_contents);
params.source_contents = source_contents;
params.disposition = disposition;
params.window_bounds = initial_pos;
params.window_bounds = initial_rect;
params.window_action = NavigateParams::SHOW_WINDOW;
// At this point, we're already beyond the popup blocker. Even if the popup
// was created without a user gesture, we have to set |user_gesture| to true,

@ -37,14 +37,15 @@ content::WebContents* AddSelectedTabWithURL(Browser* browser,
// Creates a new tab with the already-created WebContents 'new_contents'.
// The window for the added contents will be reparented correctly when this
// method returns. If |disposition| is NEW_POPUP, |pos| should hold the
// initial position. If |was_blocked| is non-NULL, then |*was_blocked| will be
// set to true if the popup gets blocked, and left unchanged otherwise.
// method returns. If |disposition| is NEW_POPUP, |initial_rect| should hold
// the initial position and size. If |was_blocked| is non-NULL, then
// |*was_blocked| will be set to true if the popup gets blocked, and left
// unchanged otherwise.
void AddWebContents(Browser* browser,
content::WebContents* source_contents,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was__blocked);

@ -67,7 +67,7 @@ public:
void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
void LoadingStateChanged(content::WebContents* source,
@ -225,15 +225,15 @@ void WebDialogWindowDelegateBridge::AddNewContents(
content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
if (delegate_ && delegate_->HandleAddNewContents(
source, new_contents, disposition, initial_pos, user_gesture)) {
source, new_contents, disposition, initial_rect, user_gesture)) {
return;
}
WebDialogWebContentsDelegate::AddNewContents(
source, new_contents, disposition, initial_pos, user_gesture,
source, new_contents, disposition, initial_rect, user_gesture,
was_blocked);
}

@ -138,7 +138,7 @@ void PanelHost::NavigationStateChanged(content::WebContents* source,
void PanelHost::AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
chrome::NavigateParams navigate_params(profile_, new_contents->GetURL(),
@ -150,7 +150,7 @@ void PanelHost::AddNewContents(content::WebContents* source,
navigate_params.disposition =
disposition == NEW_BACKGROUND_TAB ? disposition : NEW_FOREGROUND_TAB;
navigate_params.window_bounds = initial_pos;
navigate_params.window_bounds = initial_rect;
navigate_params.user_gesture = user_gesture;
navigate_params.extension_app_id = panel_->extension_id();
chrome::Navigate(&navigate_params);

@ -56,7 +56,7 @@ class PanelHost : public content::WebContentsDelegate,
void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
void ActivateContents(content::WebContents* contents) override;

@ -72,15 +72,15 @@ WebContents* ChromeWebContentsHandler::OpenURLFromTab(
// Creates a new tab with |new_contents|. |context| is the browser context that
// the browser should be owned by. |source| is the WebContent where the
// operation originated. |disposition| controls how the new tab should be
// opened. |initial_pos| is the position of the window if a new window is
// created. |user_gesture| is true if the operation was started by a user
// opened. |initial_rect| is the position and size of the window if a new window
// is created. |user_gesture| is true if the operation was started by a user
// gesture.
void ChromeWebContentsHandler::AddNewContents(
content::BrowserContext* context,
WebContents* source,
WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) {
if (!context)
return;
@ -102,7 +102,7 @@ void ChromeWebContentsHandler::AddNewContents(
chrome::NavigateParams params(browser, new_contents);
params.source_contents = source;
params.disposition = disposition;
params.window_bounds = initial_pos;
params.window_bounds = initial_rect;
params.window_action = chrome::NavigateParams::SHOW_WINDOW;
params.user_gesture = true;
chrome::Navigate(&params);

@ -23,7 +23,7 @@ class ChromeWebContentsHandler
content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) override;
private:

@ -107,7 +107,7 @@ void CastWindowAndroid::LoadURL(const GURL& url) {
void CastWindowAndroid::AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
NOTIMPLEMENTED();

@ -59,7 +59,7 @@ class CastWindowAndroid : public content::WebContentsDelegate,
virtual void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
virtual void CloseContents(content::WebContents* source) override;

@ -867,8 +867,8 @@ void BrowserPluginGuest::OnShowPopup(
#endif
void BrowserPluginGuest::OnShowWidget(int route_id,
const gfx::Rect& initial_pos) {
GetWebContents()->ShowCreatedWidget(route_id, initial_pos);
const gfx::Rect& initial_rect) {
GetWebContents()->ShowCreatedWidget(route_id, initial_rect);
}
void BrowserPluginGuest::OnTakeFocus(bool reverse) {

@ -331,7 +331,7 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestSizer,
void OnShowPopup(RenderFrameHost* render_frame_host,
const FrameHostMsg_ShowPopup_Params& params);
#endif
void OnShowWidget(int route_id, const gfx::Rect& initial_pos);
void OnShowWidget(int route_id, const gfx::Rect& initial_rect);
void OnTakeFocus(bool reverse);
void OnUpdateFrameName(int frame_id,
bool is_top_level,

@ -740,13 +740,13 @@ void InterstitialPageImpl::CreateNewFullscreenWidget(int render_process_id,
void InterstitialPageImpl::ShowCreatedWindow(int route_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) {
NOTREACHED() << "InterstitialPage does not support showing popups yet.";
}
void InterstitialPageImpl::ShowCreatedWidget(int route_id,
const gfx::Rect& initial_pos) {
const gfx::Rect& initial_rect) {
NOTREACHED() << "InterstitialPage does not support showing drop-downs yet.";
}

@ -130,9 +130,9 @@ class CONTENT_EXPORT InterstitialPageImpl
void CreateNewFullscreenWidget(int render_process_id, int route_id) override;
void ShowCreatedWindow(int route_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) override;
void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos) override;
void ShowCreatedWidget(int route_id, const gfx::Rect& initial_rect) override;
void ShowCreatedFullscreenWidget(int route_id) override;
SessionStorageNamespace* GetSessionStorageNamespace(

@ -107,7 +107,7 @@ gfx::Size RenderWidgetHostViewChildFrame::GetPhysicalBackingSize() const {
void RenderWidgetHostViewChildFrame::InitAsPopup(
RenderWidgetHostView* parent_host_view,
const gfx::Rect& pos) {
const gfx::Rect& bounds) {
NOTREACHED();
}

@ -57,7 +57,7 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
// RenderWidgetHostViewBase implementation.
void InitAsPopup(RenderWidgetHostView* parent_host_view,
const gfx::Rect& pos) override;
const gfx::Rect& bounds) override;
void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override;
void MovePluginWindows(const std::vector<WebPluginGeometry>& moves) override;
void Blur() override;

@ -218,7 +218,7 @@ void RenderWidgetHostViewGuest::InitAsChild(
}
void RenderWidgetHostViewGuest::InitAsPopup(
RenderWidgetHostView* parent_host_view, const gfx::Rect& pos) {
RenderWidgetHostView* parent_host_view, const gfx::Rect& bounds) {
// This should never get called.
NOTREACHED();
}

@ -67,7 +67,7 @@ class CONTENT_EXPORT RenderWidgetHostViewGuest
// RenderWidgetHostViewBase implementation.
void InitAsPopup(RenderWidgetHostView* parent_host_view,
const gfx::Rect& pos) override;
const gfx::Rect& bounds) override;
void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override;
void MovePluginWindows(const std::vector<WebPluginGeometry>& moves) override;
void UpdateCursor(const WebCursor& cursor) override;

@ -250,13 +250,13 @@ class CONTENT_EXPORT RenderViewHostDelegate {
// the Windows function which is actually a #define.
virtual void ShowCreatedWindow(int route_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) {}
// Show the newly created widget with the specified bounds.
// The widget is identified by the route_id passed to CreateNewWidget.
virtual void ShowCreatedWidget(int route_id,
const gfx::Rect& initial_pos) {}
const gfx::Rect& initial_rect) {}
// Show the newly created full screen widget. Similar to above.
virtual void ShowCreatedFullscreenWidget(int route_id) {}

@ -1001,19 +1001,19 @@ void RenderViewHostImpl::CreateNewFullscreenWidget(int route_id) {
void RenderViewHostImpl::OnShowView(int route_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) {
if (is_active_) {
delegate_->ShowCreatedWindow(
route_id, disposition, initial_pos, user_gesture);
route_id, disposition, initial_rect, user_gesture);
}
Send(new ViewMsg_Move_ACK(route_id));
}
void RenderViewHostImpl::OnShowWidget(int route_id,
const gfx::Rect& initial_pos) {
const gfx::Rect& initial_rect) {
if (is_active_)
delegate_->ShowCreatedWidget(route_id, initial_pos);
delegate_->ShowCreatedWidget(route_id, initial_rect);
Send(new ViewMsg_Move_ACK(route_id));
}

@ -334,9 +334,9 @@ class CONTENT_EXPORT RenderViewHostImpl
// IPC message handlers.
void OnShowView(int route_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture);
void OnShowWidget(int route_id, const gfx::Rect& initial_pos);
void OnShowWidget(int route_id, const gfx::Rect& initial_rect);
void OnShowFullscreenWidget(int route_id);
void OnRunModal(int opener_id, IPC::Message* reply_msg);
void OnRenderViewReady();

@ -193,7 +193,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
// Perform all the initialization steps necessary for this object to represent
// a popup (such as a <select> dropdown), then shows the popup at |pos|.
virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
const gfx::Rect& pos) = 0;
const gfx::Rect& bounds) = 0;
// Perform all the initialization steps necessary for this object to represent
// a full screen window.

@ -1644,9 +1644,9 @@ void WebContentsImpl::CreateNewWindow(
// new window. As a result, we need to show and navigate the window here.
bool was_blocked = false;
if (delegate_) {
gfx::Rect initial_pos;
gfx::Rect initial_rect;
delegate_->AddNewContents(
this, new_contents, params.disposition, initial_pos,
this, new_contents, params.disposition, initial_rect,
params.user_gesture, &was_blocked);
}
if (!was_blocked) {
@ -1716,21 +1716,21 @@ void WebContentsImpl::CreateNewWidget(int render_process_id,
void WebContentsImpl::ShowCreatedWindow(int route_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) {
WebContentsImpl* contents = GetCreatedWindow(route_id);
if (contents) {
WebContentsDelegate* delegate = GetDelegate();
if (delegate) {
delegate->AddNewContents(
this, contents, disposition, initial_pos, user_gesture, NULL);
this, contents, disposition, initial_rect, user_gesture, NULL);
}
}
}
void WebContentsImpl::ShowCreatedWidget(int route_id,
const gfx::Rect& initial_pos) {
ShowCreatedWidget(route_id, false, initial_pos);
const gfx::Rect& initial_rect) {
ShowCreatedWidget(route_id, false, initial_rect);
}
void WebContentsImpl::ShowCreatedFullscreenWidget(int route_id) {
@ -1739,7 +1739,7 @@ void WebContentsImpl::ShowCreatedFullscreenWidget(int route_id) {
void WebContentsImpl::ShowCreatedWidget(int route_id,
bool is_fullscreen,
const gfx::Rect& initial_pos) {
const gfx::Rect& initial_rect) {
RenderWidgetHostViewBase* widget_host_view =
static_cast<RenderWidgetHostViewBase*>(GetCreatedWidget(route_id));
if (!widget_host_view)
@ -1769,7 +1769,7 @@ void WebContentsImpl::ShowCreatedWidget(int route_id,
if (!widget_host_view->HasFocus())
widget_host_view->Focus();
} else {
widget_host_view->InitAsPopup(view, initial_pos);
widget_host_view->InitAsPopup(view, initial_rect);
}
RenderWidgetHostImpl* render_widget_host_impl =

@ -473,9 +473,9 @@ class CONTENT_EXPORT WebContentsImpl
void CreateNewFullscreenWidget(int render_process_id, int route_id) override;
void ShowCreatedWindow(int route_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) override;
void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos) override;
void ShowCreatedWidget(int route_id, const gfx::Rect& initial_rect) override;
void ShowCreatedFullscreenWidget(int route_id) override;
void RequestMediaAccessPermission(
const MediaStreamRequest& request,
@ -887,7 +887,7 @@ class CONTENT_EXPORT WebContentsImpl
// Helper for ShowCreatedWidget/ShowCreatedFullscreenWidget.
void ShowCreatedWidget(int route_id,
bool is_fullscreen,
const gfx::Rect& initial_pos);
const gfx::Rect& initial_rect);
// Finds the new RenderWidgetHost and returns it. Note that this can only be
// called once as this call also removes it from the internal map.

@ -1043,19 +1043,19 @@ IPC_SYNC_MESSAGE_CONTROL0_2(ViewHostMsg_GetProcessMemorySizes,
// page/widget that was created by
// CreateWindow/CreateWidget/CreateFullscreenWidget. routing_id
// refers to the id that was returned from the Create message above.
// The initial_position parameter is a rectangle in screen coordinates.
// The initial_rect parameter is in screen coordinates.
//
// FUTURE: there will probably be flags here to control if the result is
// in a new window.
IPC_MESSAGE_ROUTED4(ViewHostMsg_ShowView,
int /* route_id */,
WindowOpenDisposition /* disposition */,
gfx::Rect /* initial_pos */,
gfx::Rect /* initial_rect */,
bool /* opened_by_user_gesture */)
IPC_MESSAGE_ROUTED2(ViewHostMsg_ShowWidget,
int /* route_id */,
gfx::Rect /* initial_pos */)
gfx::Rect /* initial_rect */)
// Message to show a full screen widget.
IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowFullscreenWidget,

@ -94,14 +94,14 @@ class CONTENT_EXPORT WebContentsDelegate {
// Creates a new tab with the already-created WebContents 'new_contents'.
// The window for the added contents should be reparented correctly when this
// method returns. If |disposition| is NEW_POPUP, |initial_pos| should hold
// the initial position. If |was_blocked| is non-nullptr, then |*was_blocked|
// will be set to true if the popup gets blocked, and left unchanged
// otherwise.
// method returns. If |disposition| is NEW_POPUP, |initial_rect| should hold
// the initial position and size. If |was_blocked| is non-nullptr, then
// |*was_blocked| will be set to true if the popup gets blocked, and left
// unchanged otherwise.
virtual void AddNewContents(WebContents* source,
WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {}

@ -213,10 +213,10 @@ void Shell::LoadDataWithBaseURL(const GURL& url, const std::string& data,
void Shell::AddNewContents(WebContents* source,
WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
CreateShell(new_contents, AdjustWindowSize(initial_pos.size()));
CreateShell(new_contents, AdjustWindowSize(initial_rect.size()));
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDumpRenderTree))
NotifyDoneForwarder::CreateForWebContents(new_contents);

@ -115,7 +115,7 @@ class Shell : public WebContentsDelegate,
void AddNewContents(WebContents* source,
WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
void LoadingStateChanged(WebContents* source,

@ -87,7 +87,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostViewBase {
// RenderWidgetHostViewBase implementation.
void InitAsPopup(RenderWidgetHostView* parent_host_view,
const gfx::Rect& pos) override {}
const gfx::Rect& bounds) override {}
void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override {}
void MovePluginWindows(const std::vector<WebPluginGeometry>& moves) override {
}

@ -256,12 +256,12 @@ void TestWebContents::CreateNewFullscreenWidget(int render_process_id,
void TestWebContents::ShowCreatedWindow(int route_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) {
}
void TestWebContents::ShowCreatedWidget(int route_id,
const gfx::Rect& initial_pos) {
const gfx::Rect& initial_rect) {
}
void TestWebContents::ShowCreatedFullscreenWidget(int route_id) {

@ -112,9 +112,9 @@ class TestWebContents : public WebContentsImpl, public WebContentsTester {
void CreateNewFullscreenWidget(int render_process_id, int route_id) override;
void ShowCreatedWindow(int route_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) override;
void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos) override;
void ShowCreatedWidget(int route_id, const gfx::Rect& initial_rect) override;
void ShowCreatedFullscreenWidget(int route_id) override;
RenderViewHostDelegateView* delegate_view_override_;

@ -50,7 +50,7 @@ class AppDelegate {
virtual void AddNewContents(content::BrowserContext* context,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) = 0;

@ -373,14 +373,14 @@ WebContents* AppWindow::OpenURLFromTab(WebContents* source,
void AppWindow::AddNewContents(WebContents* source,
WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
DCHECK(new_contents->GetBrowserContext() == browser_context_);
app_delegate_->AddNewContents(browser_context_,
new_contents,
disposition,
initial_pos,
initial_rect,
user_gesture,
was_blocked);
}

@ -394,7 +394,7 @@ class AppWindow : public content::NotificationObserver,
void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
bool PreHandleKeyboardEvent(content::WebContents* source,

@ -434,7 +434,7 @@ content::JavaScriptDialogManager* ExtensionHost::GetJavaScriptDialogManager(
void ExtensionHost::AddNewContents(WebContents* source,
WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
// First, if the creating extension view was associated with a tab contents,
@ -453,7 +453,7 @@ void ExtensionHost::AddNewContents(WebContents* source,
WebContentsDelegate* delegate = associated_contents->GetDelegate();
if (delegate) {
delegate->AddNewContents(
associated_contents, new_contents, disposition, initial_pos,
associated_contents, new_contents, disposition, initial_rect,
user_gesture, was_blocked);
return;
}
@ -461,7 +461,7 @@ void ExtensionHost::AddNewContents(WebContents* source,
}
delegate_->CreateTab(
new_contents, extension_id_, disposition, initial_pos, user_gesture);
new_contents, extension_id_, disposition, initial_rect, user_gesture);
}
void ExtensionHost::RenderViewReady() {

@ -109,7 +109,7 @@ class ExtensionHost : public content::WebContentsDelegate,
void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
void CloseContents(content::WebContents* contents) override;

@ -46,7 +46,7 @@ class ExtensionHostDelegate {
virtual void CreateTab(content::WebContents* web_contents,
const std::string& extension_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) = 0;
// Requests access to an audio or video media stream. Invokes |callback|

@ -1084,13 +1084,13 @@ bool WebViewGuest::LoadDataWithBaseURL(const std::string& data_url,
void WebViewGuest::AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
if (was_blocked)
*was_blocked = false;
RequestNewWindowPermission(disposition,
initial_pos,
initial_rect,
user_gesture,
new_contents);
}

@ -148,7 +148,7 @@ class WebViewGuest : public GuestView<WebViewGuest>,
void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
content::WebContents* OpenURLFromTab(

@ -42,7 +42,7 @@ content::WebContents* ShellAppDelegate::OpenURLFromTab(
void ShellAppDelegate::AddNewContents(content::BrowserContext* context,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
NOTIMPLEMENTED();

@ -29,7 +29,7 @@ class ShellAppDelegate : public AppDelegate {
void AddNewContents(content::BrowserContext* context,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
content::ColorChooser* ShowColorChooser(content::WebContents* web_contents,

@ -36,7 +36,7 @@ ShellExtensionHostDelegate::GetJavaScriptDialogManager() {
void ShellExtensionHostDelegate::CreateTab(content::WebContents* web_contents,
const std::string& extension_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) {
// TODO(jamescook): Should app_shell support opening popup windows?
NOTREACHED();

@ -23,7 +23,7 @@ class ShellExtensionHostDelegate : public ExtensionHostDelegate {
void CreateTab(content::WebContents* web_contents,
const std::string& extension_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) override;
void ProcessMediaAccessRequest(content::WebContents* web_contents,
const content::MediaStreamRequest& request,

@ -306,15 +306,15 @@ content::WebContents* WebDialogView::OpenURLFromTab(
void WebDialogView::AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
if (delegate_ && delegate_->HandleAddNewContents(
source, new_contents, disposition, initial_pos, user_gesture)) {
source, new_contents, disposition, initial_rect, user_gesture)) {
return;
}
WebDialogWebContentsDelegate::AddNewContents(
source, new_contents, disposition, initial_pos, user_gesture,
source, new_contents, disposition, initial_rect, user_gesture,
was_blocked);
}

@ -103,7 +103,7 @@ class WEBVIEW_EXPORT WebDialogView : public views::ClientView,
void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
void LoadingStateChanged(content::WebContents* source,

@ -24,7 +24,7 @@ void TestWebContentsHandler::AddNewContents(content::BrowserContext* context,
content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) {
}

@ -28,7 +28,7 @@ class TestWebContentsHandler
content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) override;
DISALLOW_COPY_AND_ASSIGN(TestWebContentsHandler);

@ -43,7 +43,7 @@ bool WebDialogDelegate::HandleAddNewContents(
content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) {
return false;
}

@ -120,13 +120,13 @@ class WEB_DIALOGS_EXPORT WebDialogDelegate {
// A callback to create a new tab with |new_contents|. |source| is the
// WebContent where the operation originated. |disposition| controls how the
// new tab should be opened. |initial_pos| is the position of the window if a
// new window is created. |user_gesture| is true if the operation was started
// by a user gesture. Return false to use the default handler.
// new tab should be opened. |initial_rect| is the position and size of the
// window if a new window is created. |user_gesture| is true if the operation
// was started by a user gesture. Return false to use the default handler.
virtual bool HandleAddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture);
// A callback to control whether a WebContents will be created. Returns

@ -42,11 +42,11 @@ WebContents* WebDialogWebContentsDelegate::OpenURLFromTab(
void WebDialogWebContentsDelegate::AddNewContents(
WebContents* source, WebContents* new_contents,
WindowOpenDisposition disposition, const gfx::Rect& initial_pos,
WindowOpenDisposition disposition, const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
handler_->AddNewContents(browser_context_, source, new_contents, disposition,
initial_pos, user_gesture);
initial_rect, user_gesture);
}
bool WebDialogWebContentsDelegate::IsPopupOrPanel(

@ -31,7 +31,7 @@ class WEB_DIALOGS_EXPORT WebDialogWebContentsDelegate
content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture) = 0;
};
@ -59,7 +59,7 @@ class WEB_DIALOGS_EXPORT WebDialogWebContentsDelegate
void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
bool IsPopupOrPanel(const content::WebContents* source) const override;