Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(707)

Unified Diff: chrome/browser/ui/browser_navigator.cc

Issue 23129015: Initialize RenderWidget(Host)(View)s with correct visibility state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/tabs/tab_strip_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_navigator.cc
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc
index 990693ee4d1a37320c763d67b4bfcdce6e50c128..02a5e8fbd261039c46b400d647a841450a9f2fe3 100644
--- a/chrome/browser/ui/browser_navigator.cc
+++ b/chrome/browser/ui/browser_navigator.cc
@@ -332,6 +332,9 @@ content::WebContents* CreateTargetContents(const chrome::NavigateParams& params,
if (params.should_set_opener)
create_params.opener = params.source_contents;
}
+ if (params.disposition == NEW_BACKGROUND_TAB)
+ create_params.initially_hidden = true;
+
#if defined(USE_AURA)
if (params.browser->window() &&
params.browser->window()->GetNativeWindow()) {
@@ -348,14 +351,6 @@ content::WebContents* CreateTargetContents(const chrome::NavigateParams& params,
BrowserNavigatorWebContentsAdoption::AttachTabHelpers(target_contents);
extensions::TabHelper::FromWebContents(target_contents)->
SetExtensionAppById(params.extension_app_id);
- // TODO(sky): Figure out why this is needed. Without it we seem to get
- // failures in startup tests.
- // By default, content believes it is not hidden. When adding contents
- // in the background, tell it that it's hidden.
- if ((params.tabstrip_add_types & TabStripModel::ADD_ACTIVE) == 0) {
- // TabStripModel::AddWebContents invokes WasHidden if not foreground.
- target_contents->WasHidden();
- }
return target_contents;
}
« no previous file with comments | « no previous file | chrome/browser/ui/tabs/tab_strip_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698