| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_toolbar_gtk.h" | 5 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h" |
| 6 | 6 |
| 7 #include <X11/XF86keysym.h> | 7 #include <X11/XF86keysym.h> |
| 8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
| 24 #include "chrome/browser/ui/global_error_service.h" | 24 #include "chrome/browser/ui/global_error_service.h" |
| 25 #include "chrome/browser/ui/global_error_service_factory.h" | 25 #include "chrome/browser/ui/global_error_service_factory.h" |
| 26 #include "chrome/browser/ui/gtk/accelerators_gtk.h" | 26 #include "chrome/browser/ui/gtk/accelerators_gtk.h" |
| 27 #include "chrome/browser/ui/gtk/back_forward_button_gtk.h" | 27 #include "chrome/browser/ui/gtk/back_forward_button_gtk.h" |
| 28 #include "chrome/browser/ui/gtk/bookmarks/bookmark_sub_menu_model_gtk.h" | 28 #include "chrome/browser/ui/gtk/bookmarks/bookmark_sub_menu_model_gtk.h" |
| 29 #include "chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h" | 29 #include "chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h" |
| 30 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 30 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| 31 #include "chrome/browser/ui/gtk/custom_button.h" | 31 #include "chrome/browser/ui/gtk/custom_button.h" |
| 32 #include "chrome/browser/ui/gtk/gtk_chrome_button.h" | 32 #include "chrome/browser/ui/gtk/gtk_chrome_button.h" |
| 33 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | |
| 34 #include "chrome/browser/ui/gtk/gtk_util.h" | 33 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 35 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" | 34 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" |
| 36 #include "chrome/browser/ui/gtk/reload_button_gtk.h" | 35 #include "chrome/browser/ui/gtk/reload_button_gtk.h" |
| 37 #include "chrome/browser/ui/gtk/rounded_window.h" | 36 #include "chrome/browser/ui/gtk/rounded_window.h" |
| 38 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" | 37 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" |
| 38 #include "chrome/browser/ui/gtk/theme_service_gtk.h" |
| 39 #include "chrome/browser/ui/gtk/view_id_util.h" | 39 #include "chrome/browser/ui/gtk/view_id_util.h" |
| 40 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" | 40 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" |
| 41 #include "chrome/browser/upgrade_detector.h" | 41 #include "chrome/browser/upgrade_detector.h" |
| 42 #include "chrome/common/chrome_notification_types.h" | 42 #include "chrome/common/chrome_notification_types.h" |
| 43 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
| 44 #include "chrome/common/url_constants.h" | 44 #include "chrome/common/url_constants.h" |
| 45 #include "content/public/browser/host_zoom_map.h" | 45 #include "content/public/browser/host_zoom_map.h" |
| 46 #include "content/public/browser/notification_details.h" | 46 #include "content/public/browser/notification_details.h" |
| 47 #include "content/public/browser/notification_service.h" | 47 #include "content/public/browser/notification_service.h" |
| 48 #include "content/public/browser/user_metrics.h" | 48 #include "content/public/browser/user_metrics.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 browser_->command_updater()->RemoveCommandObserver(IDC_HOME, this); | 121 browser_->command_updater()->RemoveCommandObserver(IDC_HOME, this); |
| 122 browser_->command_updater()->RemoveCommandObserver(IDC_BOOKMARK_PAGE, this); | 122 browser_->command_updater()->RemoveCommandObserver(IDC_BOOKMARK_PAGE, this); |
| 123 | 123 |
| 124 offscreen_entry_.Destroy(); | 124 offscreen_entry_.Destroy(); |
| 125 | 125 |
| 126 wrench_menu_.reset(); | 126 wrench_menu_.reset(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void BrowserToolbarGtk::Init(GtkWindow* top_level_window) { | 129 void BrowserToolbarGtk::Init(GtkWindow* top_level_window) { |
| 130 Profile* profile = browser_->profile(); | 130 Profile* profile = browser_->profile(); |
| 131 theme_service_ = GtkThemeService::GetFrom(profile); | 131 theme_service_ = ThemeServiceGtk::GetFrom(profile); |
| 132 registrar_.Add(this, | 132 registrar_.Add(this, |
| 133 chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 133 chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
| 134 content::Source<ThemeService>(theme_service_)); | 134 content::Source<ThemeService>(theme_service_)); |
| 135 | 135 |
| 136 offscreen_entry_.Own(gtk_entry_new()); | 136 offscreen_entry_.Own(gtk_entry_new()); |
| 137 | 137 |
| 138 show_home_button_.Init(prefs::kShowHomeButton, profile->GetPrefs(), this); | 138 show_home_button_.Init(prefs::kShowHomeButton, profile->GetPrefs(), this); |
| 139 home_page_.Init(prefs::kHomePage, profile->GetPrefs(), this); | 139 home_page_.Init(prefs::kHomePage, profile->GetPrefs(), this); |
| 140 home_page_is_new_tab_page_.Init(prefs::kHomePageIsNewTabPage, | 140 home_page_is_new_tab_page_.Init(prefs::kHomePageIsNewTabPage, |
| 141 profile->GetPrefs(), this); | 141 profile->GetPrefs(), this); |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 const SkBitmap* badge = theme_service_->GetBitmapNamed(resource_id); | 683 const SkBitmap* badge = theme_service_->GetBitmapNamed(resource_id); |
| 684 gfx::CanvasSkiaPaint canvas(expose, false); | 684 gfx::CanvasSkiaPaint canvas(expose, false); |
| 685 int x_offset = base::i18n::IsRTL() ? 0 : allocation.width - badge->width(); | 685 int x_offset = base::i18n::IsRTL() ? 0 : allocation.width - badge->width(); |
| 686 int y_offset = 0; | 686 int y_offset = 0; |
| 687 canvas.DrawBitmapInt(*badge, | 687 canvas.DrawBitmapInt(*badge, |
| 688 allocation.x + x_offset, | 688 allocation.x + x_offset, |
| 689 allocation.y + y_offset); | 689 allocation.y + y_offset); |
| 690 | 690 |
| 691 return FALSE; | 691 return FALSE; |
| 692 } | 692 } |
| OLD | NEW |