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 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 new_contents->GetView()->RestoreFocus(); | 1237 new_contents->GetView()->RestoreFocus(); |
1238 FindTabHelper* find_tab_helper = | 1238 FindTabHelper* find_tab_helper = |
1239 FindTabHelper::FromWebContents(new_contents); | 1239 FindTabHelper::FromWebContents(new_contents); |
1240 if (find_tab_helper->find_ui_active()) | 1240 if (find_tab_helper->find_ui_active()) |
1241 browser_->GetFindBarController()->find_bar()->SetFocusAndSelection(); | 1241 browser_->GetFindBarController()->find_bar()->SetFocusAndSelection(); |
1242 } | 1242 } |
1243 | 1243 |
1244 // Update all the UI bits. | 1244 // Update all the UI bits. |
1245 UpdateTitleBar(); | 1245 UpdateTitleBar(); |
1246 MaybeShowBookmarkBar(false); | 1246 MaybeShowBookmarkBar(false); |
| 1247 |
| 1248 // The Browser expects a platform-specific TabStripModelObserver to call |
| 1249 // OnActiveTabChanged(). |
| 1250 browser_->OnActiveTabChanged(old_contents, new_contents, index, reason); |
1247 } | 1251 } |
1248 | 1252 |
1249 void BrowserWindowGtk::ActiveWindowChanged(GdkWindow* active_window) { | 1253 void BrowserWindowGtk::ActiveWindowChanged(GdkWindow* active_window) { |
1250 // Do nothing if we're in the process of closing the browser window. | 1254 // Do nothing if we're in the process of closing the browser window. |
1251 if (!window_) | 1255 if (!window_) |
1252 return; | 1256 return; |
1253 | 1257 |
1254 bool is_active = gtk_widget_get_window(GTK_WIDGET(window_)) == active_window; | 1258 bool is_active = gtk_widget_get_window(GTK_WIDGET(window_)) == active_window; |
1255 bool changed = (is_active != is_active_); | 1259 bool changed = (is_active != is_active_); |
1256 | 1260 |
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2414 wm_type == ui::WM_OPENBOX || | 2418 wm_type == ui::WM_OPENBOX || |
2415 wm_type == ui::WM_XFWM4); | 2419 wm_type == ui::WM_XFWM4); |
2416 } | 2420 } |
2417 | 2421 |
2418 // static | 2422 // static |
2419 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2423 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
2420 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2424 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
2421 browser_window_gtk->Init(); | 2425 browser_window_gtk->Init(); |
2422 return browser_window_gtk; | 2426 return browser_window_gtk; |
2423 } | 2427 } |
OLD | NEW |