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

Unified Diff: chrome/browser/ui/gtk/browser_window_gtk.cc

Issue 11364196: Remove TabContents from TabStripModelObserver::ActiveTabChanged. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 1 month 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 | « chrome/browser/ui/gtk/browser_window_gtk.h ('k') | chrome/browser/ui/gtk/tabs/tab_strip_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/browser_window_gtk.cc
diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc
index e9820ab3cdea0adbb0099e4b577c38389f298693..4035e968d5b83cb508b2458cc34e31db5a5169a2 100644
--- a/chrome/browser/ui/gtk/browser_window_gtk.cc
+++ b/chrome/browser/ui/gtk/browser_window_gtk.cc
@@ -1216,28 +1216,28 @@ void BrowserWindowGtk::TabDetachedAt(WebContents* contents, int index) {
contents_container_->DetachTab(contents);
}
-void BrowserWindowGtk::ActiveTabChanged(TabContents* old_contents,
- TabContents* new_contents,
+void BrowserWindowGtk::ActiveTabChanged(WebContents* old_contents,
+ WebContents* new_contents,
int index,
bool user_gesture) {
TRACE_EVENT0("ui::gtk", "BrowserWindowGtk::ActiveTabChanged");
- if (old_contents && !old_contents->in_destructor())
- old_contents->web_contents()->GetView()->StoreFocus();
+ if (old_contents && !old_contents->IsBeingDestroyed())
+ old_contents->GetView()->StoreFocus();
// Update various elements that are interested in knowing the current
// WebContents.
- UpdateDevToolsForContents(new_contents->web_contents());
+ UpdateDevToolsForContents(new_contents);
InfoBarTabHelper* new_infobar_tab_helper =
- InfoBarTabHelper::FromWebContents(new_contents->web_contents());
+ InfoBarTabHelper::FromWebContents(new_contents);
infobar_container_->ChangeTabContents(new_infobar_tab_helper);
- contents_container_->SetTab(new_contents);
+ contents_container_->SetTab(TabContents::FromWebContents(new_contents));
// TODO(estade): after we manage browser activation, add a check to make sure
// we are the active browser before calling RestoreFocus().
if (!browser_->tab_strip_model()->closing_all()) {
- new_contents->web_contents()->GetView()->RestoreFocus();
+ new_contents->GetView()->RestoreFocus();
FindTabHelper* find_tab_helper =
- FindTabHelper::FromWebContents(new_contents->web_contents());
+ FindTabHelper::FromWebContents(new_contents);
if (find_tab_helper->find_ui_active())
browser_->GetFindBarController()->find_bar()->SetFocusAndSelection();
}
« no previous file with comments | « chrome/browser/ui/gtk/browser_window_gtk.h ('k') | chrome/browser/ui/gtk/tabs/tab_strip_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698