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

Unified Diff: chrome/browser/sessions/tab_loader.cc

Issue 1747143002: Remove WebContents::WasHidden() calls in chrome::AddRestoredTab() and TabLoader Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also remove from TabLoader, fix RenderWidgetHostViewMac Created 4 years, 10 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/browser_tabrestore.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/tab_loader.cc
diff --git a/chrome/browser/sessions/tab_loader.cc b/chrome/browser/sessions/tab_loader.cc
index 676db802f58f34533763271946b0b924b2d9d58c..bbcc670eb08c103dc039037262ea4e4f84f5edc0 100644
--- a/chrome/browser/sessions/tab_loader.cc
+++ b/chrome/browser/sessions/tab_loader.cc
@@ -174,17 +174,12 @@ void TabLoader::LoadNextTab() {
content::WebContents* contents = controller->GetWebContents();
if (contents) {
Browser* browser = chrome::FindBrowserWithWebContents(contents);
- if (browser &&
- browser->tab_strip_model()->GetActiveWebContents() != contents) {
- // By default tabs are marked as visible. As only the active tab is
- // visible we need to explicitly tell non-active tabs they are hidden.
- // Without this call non-active tabs are not marked as backgrounded.
- //
- // NOTE: We need to do this here rather than when the tab is added to
- // the Browser as at that time not everything has been created, so that
- // the call would do nothing.
- contents->WasHidden();
- }
+ bool is_active = browser &&
+ browser->tab_strip_model()->GetActiveWebContents() == contents;
+
+ // Background tabs should have been loaded with WebContents::CreateParams
+ // initially_hidden = true. Ensure this is reflected in the tab status.
+ DCHECK_EQ(is_active, contents->GetRenderWidgetHostView()->IsShowing());
}
}
« no previous file with comments | « no previous file | chrome/browser/ui/browser_tabrestore.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698