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 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 } | 1191 } |
1192 | 1192 |
1193 void BrowserWindowGtk::Observe(int type, | 1193 void BrowserWindowGtk::Observe(int type, |
1194 const content::NotificationSource& source, | 1194 const content::NotificationSource& source, |
1195 const content::NotificationDetails& details) { | 1195 const content::NotificationDetails& details) { |
1196 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, type); | 1196 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, type); |
1197 // The profile avatar icon may have changed. | 1197 // The profile avatar icon may have changed. |
1198 gtk_util::SetWindowIcon(window_, browser_->profile()); | 1198 gtk_util::SetWindowIcon(window_, browser_->profile()); |
1199 } | 1199 } |
1200 | 1200 |
1201 void BrowserWindowGtk::TabDetachedAt(WebContents* contents, int index) { | 1201 void BrowserWindowGtk::TabDetachedAt(WebContents* contents, |
| 1202 int index, |
| 1203 bool closing_all) { |
1202 // We use index here rather than comparing |contents| because by this time | 1204 // We use index here rather than comparing |contents| because by this time |
1203 // the model has already removed |contents| from its list, so | 1205 // the model has already removed |contents| from its list, so |
1204 // browser_->tab_strip_model()->GetActiveWebContents() will return NULL or | 1206 // browser_->tab_strip_model()->GetActiveWebContents() will return NULL or |
1205 // something else. | 1207 // something else. |
1206 if (index == browser_->tab_strip_model()->active_index()) { | 1208 if (index == browser_->tab_strip_model()->active_index()) { |
1207 infobar_container_->ChangeInfoBarService(NULL); | 1209 infobar_container_->ChangeInfoBarService(NULL); |
1208 UpdateDevToolsForContents(NULL); | 1210 UpdateDevToolsForContents(NULL); |
1209 } | 1211 } |
1210 contents_container_->DetachTab(contents); | 1212 contents_container_->DetachTab(contents); |
1211 } | 1213 } |
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2411 wm_type == ui::WM_OPENBOX || | 2413 wm_type == ui::WM_OPENBOX || |
2412 wm_type == ui::WM_XFWM4); | 2414 wm_type == ui::WM_XFWM4); |
2413 } | 2415 } |
2414 | 2416 |
2415 // static | 2417 // static |
2416 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2418 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
2417 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2419 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
2418 browser_window_gtk->Init(); | 2420 browser_window_gtk->Init(); |
2419 return browser_window_gtk; | 2421 return browser_window_gtk; |
2420 } | 2422 } |
OLD | NEW |