| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <dlfcn.h> | 9 #include <dlfcn.h> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "chrome/browser/themes/theme_service.h" | 34 #include "chrome/browser/themes/theme_service.h" |
| 35 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" | 35 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" |
| 36 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 36 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
| 37 #include "chrome/browser/ui/browser.h" | 37 #include "chrome/browser/ui/browser.h" |
| 38 #include "chrome/browser/ui/browser_dialogs.h" | 38 #include "chrome/browser/ui/browser_dialogs.h" |
| 39 #include "chrome/browser/ui/browser_list.h" | 39 #include "chrome/browser/ui/browser_list.h" |
| 40 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 40 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 41 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 41 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 42 #include "chrome/browser/ui/gtk/about_chrome_dialog.h" | 42 #include "chrome/browser/ui/gtk/about_chrome_dialog.h" |
| 43 #include "chrome/browser/ui/gtk/accelerators_gtk.h" | 43 #include "chrome/browser/ui/gtk/accelerators_gtk.h" |
| 44 #include "chrome/browser/ui/gtk/avatar_menu_button_gtk.h" |
| 44 #include "chrome/browser/ui/gtk/avatar_menu_bubble_gtk.h" | 45 #include "chrome/browser/ui/gtk/avatar_menu_bubble_gtk.h" |
| 45 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h" | 46 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h" |
| 46 #include "chrome/browser/ui/gtk/browser_titlebar.h" | 47 #include "chrome/browser/ui/gtk/browser_titlebar.h" |
| 47 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h" | 48 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h" |
| 48 #include "chrome/browser/ui/gtk/cairo_cached_surface.h" | 49 #include "chrome/browser/ui/gtk/cairo_cached_surface.h" |
| 49 #include "chrome/browser/ui/gtk/collected_cookies_gtk.h" | 50 #include "chrome/browser/ui/gtk/collected_cookies_gtk.h" |
| 50 #include "chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h" | 51 #include "chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h" |
| 51 #include "chrome/browser/ui/gtk/download/download_in_progress_dialog_gtk.h" | 52 #include "chrome/browser/ui/gtk/download/download_in_progress_dialog_gtk.h" |
| 52 #include "chrome/browser/ui/gtk/download/download_shelf_gtk.h" | 53 #include "chrome/browser/ui/gtk/download/download_shelf_gtk.h" |
| 53 #include "chrome/browser/ui/gtk/edit_search_engine_dialog.h" | 54 #include "chrome/browser/ui/gtk/edit_search_engine_dialog.h" |
| (...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 return new FindBarGtk(this); | 1190 return new FindBarGtk(this); |
| 1190 } | 1191 } |
| 1191 | 1192 |
| 1192 void BrowserWindowGtk::ShowAvatarBubble(TabContents* tab_contents, | 1193 void BrowserWindowGtk::ShowAvatarBubble(TabContents* tab_contents, |
| 1193 const gfx::Rect& rect) { | 1194 const gfx::Rect& rect) { |
| 1194 GtkWidget* widget = tab_contents->GetContentNativeView(); | 1195 GtkWidget* widget = tab_contents->GetContentNativeView(); |
| 1195 new AvatarMenuBubbleGtk(browser_.get(), widget, | 1196 new AvatarMenuBubbleGtk(browser_.get(), widget, |
| 1196 BubbleGtk::ARROW_LOCATION_TOP_LEFT, &rect); | 1197 BubbleGtk::ARROW_LOCATION_TOP_LEFT, &rect); |
| 1197 } | 1198 } |
| 1198 | 1199 |
| 1200 void BrowserWindowGtk::ShowAvatarBubbleFromAvatarButton() { |
| 1201 if (titlebar_->avatar_button()) |
| 1202 titlebar_->avatar_button()->ShowAvatarBubble(); |
| 1203 } |
| 1204 |
| 1199 void BrowserWindowGtk::ConfirmBrowserCloseWithPendingDownloads() { | 1205 void BrowserWindowGtk::ConfirmBrowserCloseWithPendingDownloads() { |
| 1200 new DownloadInProgressDialogGtk(browser()); | 1206 new DownloadInProgressDialogGtk(browser()); |
| 1201 } | 1207 } |
| 1202 | 1208 |
| 1203 void BrowserWindowGtk::Observe(int type, | 1209 void BrowserWindowGtk::Observe(int type, |
| 1204 const content::NotificationSource& source, | 1210 const content::NotificationSource& source, |
| 1205 const content::NotificationDetails& details) { | 1211 const content::NotificationDetails& details) { |
| 1206 switch (type) { | 1212 switch (type) { |
| 1207 case chrome::NOTIFICATION_PREF_CHANGED: { | 1213 case chrome::NOTIFICATION_PREF_CHANGED: { |
| 1208 std::string* pref_name = content::Details<std::string>(details).ptr(); | 1214 std::string* pref_name = content::Details<std::string>(details).ptr(); |
| (...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2407 wm_name == "Openbox" || | 2413 wm_name == "Openbox" || |
| 2408 wm_name == "Xfwm4"); | 2414 wm_name == "Xfwm4"); |
| 2409 } | 2415 } |
| 2410 | 2416 |
| 2411 // static | 2417 // static |
| 2412 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2418 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
| 2413 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2419 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
| 2414 browser_window_gtk->Init(); | 2420 browser_window_gtk->Init(); |
| 2415 return browser_window_gtk; | 2421 return browser_window_gtk; |
| 2416 } | 2422 } |
| OLD | NEW |