| 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();
|
| }
|
|
|