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

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

Issue 10831308: Revert 151036 - Speculative revert to see if this change introduced a performance regression on Mac… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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
Index: chrome/browser/sessions/session_restore.cc
===================================================================
--- chrome/browser/sessions/session_restore.cc (revision 151481)
+++ chrome/browser/sessions/session_restore.cc (working copy)
@@ -267,10 +267,10 @@
max_parallel_tab_loads_ = tabs_loading_.size();
tabs_to_load_.pop_front();
tab->LoadIfNecessary();
- if (tab->GetWebContents()) {
- int tab_index;
- Browser* browser = browser::FindBrowserForController(tab, &tab_index);
- if (browser && browser->active_index() != tab_index) {
+ content::WebContents* contents = tab->GetWebContents();
+ if (contents) {
+ Browser* browser = browser::FindBrowserWithWebContents(contents);
+ if (browser && chrome::GetActiveWebContents(browser) != 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.
@@ -278,7 +278,7 @@
// 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.
- tab->GetWebContents()->WasHidden();
+ contents->WasHidden();
}
}
}
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.cc ('k') | chrome/browser/sessions/tab_restore_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698