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 /chrome/browser/ui | |
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 'chrome/browser/ui')
-rw-r--r-- | chrome/browser/ui/browser_navigator.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/browser_navigator_browsertest.cc | 7 | ||||
-rw-r--r-- | chrome/browser/ui/browser_tabrestore.cc | 6 |
3 files changed, 16 insertions, 3 deletions
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc index 70d1a42..4765074 100644 --- a/chrome/browser/ui/browser_navigator.cc +++ b/chrome/browser/ui/browser_navigator.cc @@ -37,6 +37,7 @@ #include "content/public/browser/notification_service.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" +#include "content/public/browser/web_contents_view.h" #if defined(USE_AURA) #include "ui/aura/window.h" @@ -482,7 +483,10 @@ void Navigate(NavigateParams* params) { WebContents::CreateParams create_params( params->browser->profile(), tab_util::GetSiteInstanceForNewTab(params->browser->profile(), url)); - create_params.base_web_contents = params->source_contents; + if (params->source_contents) { + create_params.initial_size = + params->source_contents->GetView()->GetContainerSize(); + } #if defined(USE_AURA) if (params->browser->window() && params->browser->window()->GetNativeWindow()) { diff --git a/chrome/browser/ui/browser_navigator_browsertest.cc b/chrome/browser/ui/browser_navigator_browsertest.cc index d59acf0..4457ac7 100644 --- a/chrome/browser/ui/browser_navigator_browsertest.cc +++ b/chrome/browser/ui/browser_navigator_browsertest.cc @@ -92,7 +92,12 @@ Browser* BrowserNavigatorTest::CreateEmptyBrowserForApp(Browser::Type type, WebContents* BrowserNavigatorTest::CreateWebContents() { content::WebContents::CreateParams create_params(browser()->profile()); - create_params.base_web_contents = chrome::GetActiveWebContents(browser()); + content::WebContents* base_web_contents = + chrome::GetActiveWebContents(browser()); + if (base_web_contents) { + create_params.initial_size = + base_web_contents->GetView()->GetContainerSize(); + } return WebContents::Create(create_params); } diff --git a/chrome/browser/ui/browser_tabrestore.cc b/chrome/browser/ui/browser_tabrestore.cc index 6ddc50a..85cb7f5 100644 --- a/chrome/browser/ui/browser_tabrestore.cc +++ b/chrome/browser/ui/browser_tabrestore.cc @@ -54,8 +54,12 @@ WebContents* CreateRestoredTab( WebContents::CreateParams create_params( browser->profile(), tab_util::GetSiteInstanceForNewTab(browser->profile(), restore_url)); - create_params.base_web_contents = + WebContents* base_web_contents = browser->tab_strip_model()->GetActiveWebContents(); + if (base_web_contents) { + create_params.initial_size = + base_web_contents->GetView()->GetContainerSize(); + } WebContents* web_contents = content::WebContents::CreateWithSessionStorage( create_params, session_storage_namespace_map); |