| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 5 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 void BrowserWindowGtk::OnActiveTabChanged(WebContents* old_contents, | 795 void BrowserWindowGtk::OnActiveTabChanged(WebContents* old_contents, |
| 796 WebContents* new_contents, | 796 WebContents* new_contents, |
| 797 int index, | 797 int index, |
| 798 int reason) { | 798 int reason) { |
| 799 TRACE_EVENT0("ui::gtk", "BrowserWindowGtk::ActiveTabChanged"); | 799 TRACE_EVENT0("ui::gtk", "BrowserWindowGtk::ActiveTabChanged"); |
| 800 if (old_contents && !old_contents->IsBeingDestroyed()) | 800 if (old_contents && !old_contents->IsBeingDestroyed()) |
| 801 old_contents->GetView()->StoreFocus(); | 801 old_contents->GetView()->StoreFocus(); |
| 802 | 802 |
| 803 // Update various elements that are interested in knowing the current | 803 // Update various elements that are interested in knowing the current |
| 804 // WebContents. | 804 // WebContents. |
| 805 InfoBarManager* infobar_manager = | 805 infobar_container_->ChangeInfoBarManager( |
| 806 InfoBarService::InfoBarManagerFromWebContents(new_contents); | 806 InfoBarService::FromWebContents(new_contents)); |
| 807 infobar_container_->ChangeInfoBarManager(infobar_manager); | |
| 808 contents_container_->SetTab(new_contents); | 807 contents_container_->SetTab(new_contents); |
| 809 UpdateDevToolsForContents(new_contents); | 808 UpdateDevToolsForContents(new_contents); |
| 810 | 809 |
| 811 // TODO(estade): after we manage browser activation, add a check to make sure | 810 // TODO(estade): after we manage browser activation, add a check to make sure |
| 812 // we are the active browser before calling RestoreFocus(). | 811 // we are the active browser before calling RestoreFocus(). |
| 813 if (!browser_->tab_strip_model()->closing_all()) { | 812 if (!browser_->tab_strip_model()->closing_all()) { |
| 814 new_contents->GetView()->RestoreFocus(); | 813 new_contents->GetView()->RestoreFocus(); |
| 815 FindTabHelper* find_tab_helper = | 814 FindTabHelper* find_tab_helper = |
| 816 FindTabHelper::FromWebContents(new_contents); | 815 FindTabHelper::FromWebContents(new_contents); |
| 817 if (find_tab_helper->find_ui_active()) | 816 if (find_tab_helper->find_ui_active()) |
| (...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2375 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2374 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
| 2376 browser_window_gtk->Init(); | 2375 browser_window_gtk->Init(); |
| 2377 return browser_window_gtk; | 2376 return browser_window_gtk; |
| 2378 } | 2377 } |
| 2379 | 2378 |
| 2380 // static | 2379 // static |
| 2381 chrome::HostDesktopType BrowserWindow::AdjustHostDesktopType( | 2380 chrome::HostDesktopType BrowserWindow::AdjustHostDesktopType( |
| 2382 chrome::HostDesktopType desktop_type) { | 2381 chrome::HostDesktopType desktop_type) { |
| 2383 return desktop_type; | 2382 return desktop_type; |
| 2384 } | 2383 } |
| OLD | NEW |