diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-18 08:00:45 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-18 08:00:45 +0000 |
commit | ed245db0360efc2d545244ed83f55e337368b0b5 (patch) | |
tree | c571e2bc6ee78faec7dd7326390298610bd1c870 /content/shell | |
parent | 2a58eb1b70534eb673c569f92731694d6e0dafd7 (diff) | |
download | chromium_src-ed245db0360efc2d545244ed83f55e337368b0b5.zip chromium_src-ed245db0360efc2d545244ed83f55e337368b0b5.tar.gz chromium_src-ed245db0360efc2d545244ed83f55e337368b0b5.tar.bz2 |
Instead of passing a base WebContents with WebContents::CreateParams to determine the initial size, specify the size explictely.
This elimiates a short window where the WebView has a (0, 0) windowRect if no base WebContents is given
BUG=111316
R=jam@chromium.org
Review URL: https://codereview.chromium.org/11593018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173691 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r-- | content/shell/shell.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/content/shell/shell.cc b/content/shell/shell.cc index 45f9660..f21b6f9 100644 --- a/content/shell/shell.cc +++ b/content/shell/shell.cc @@ -20,6 +20,7 @@ #include "content/public/browser/notification_types.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" +#include "content/public/browser/web_contents_view.h" #include "content/shell/shell_browser_main_parts.h" #include "content/shell/shell_content_browser_client.h" #include "content/shell/shell_devtools_delegate.h" @@ -117,7 +118,12 @@ Shell* Shell::CreateNewWindow(BrowserContext* browser_context, WebContents* base_web_contents) { WebContents::CreateParams create_params(browser_context, site_instance); create_params.routing_id = routing_id; - create_params.base_web_contents = base_web_contents; + if (base_web_contents) { + create_params.initial_size = + base_web_contents->GetView()->GetContainerSize(); + } else { + create_params.initial_size = gfx::Size(kTestWindowWidth, kTestWindowHeight); + } WebContents* web_contents = WebContents::Create(create_params); Shell* shell = CreateShell(web_contents); if (!url.is_empty()) |