| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_GTK_BROWSER_TOOLBAR_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_BROWSER_TOOLBAR_GTK_H_ |
| 6 #define CHROME_BROWSER_GTK_BROWSER_TOOLBAR_GTK_H_ | 6 #define CHROME_BROWSER_GTK_BROWSER_TOOLBAR_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "app/active_window_watcher_x.h" | 12 #include "app/active_window_watcher_x.h" |
| 13 #include "app/gtk_signal.h" | 13 #include "app/gtk_signal.h" |
| 14 #include "app/gtk_signal_registrar.h" | 14 #include "app/gtk_signal_registrar.h" |
| 15 #include "app/menus/accelerator.h" | |
| 16 #include "app/menus/simple_menu_model.h" | 15 #include "app/menus/simple_menu_model.h" |
| 17 #include "app/throb_animation.h" | 16 #include "app/throb_animation.h" |
| 18 #include "base/scoped_ptr.h" | 17 #include "base/scoped_ptr.h" |
| 19 #include "chrome/browser/command_updater.h" | 18 #include "chrome/browser/command_updater.h" |
| 20 #include "chrome/browser/gtk/custom_button.h" | 19 #include "chrome/browser/gtk/custom_button.h" |
| 21 #include "chrome/browser/gtk/menu_gtk.h" | 20 #include "chrome/browser/gtk/menu_gtk.h" |
| 22 #include "chrome/browser/gtk/owned_widget_gtk.h" | 21 #include "chrome/browser/gtk/owned_widget_gtk.h" |
| 23 #include "chrome/browser/pref_member.h" | 22 #include "chrome/browser/pref_member.h" |
| 24 #include "chrome/browser/wrench_menu_model.h" | 23 #include "chrome/browser/wrench_menu_model.h" |
| 25 #include "chrome/common/notification_observer.h" | 24 #include "chrome/common/notification_observer.h" |
| 26 #include "chrome/common/notification_registrar.h" | 25 #include "chrome/common/notification_registrar.h" |
| 27 | 26 |
| 28 class BackForwardButtonGtk; | 27 class BackForwardButtonGtk; |
| 29 class Browser; | 28 class Browser; |
| 30 class BrowserActionsToolbarGtk; | 29 class BrowserActionsToolbarGtk; |
| 31 class BrowserWindowGtk; | 30 class BrowserWindowGtk; |
| 32 class CustomDrawButton; | 31 class CustomDrawButton; |
| 33 class GtkThemeProvider; | 32 class GtkThemeProvider; |
| 34 class LocationBar; | 33 class LocationBar; |
| 35 class LocationBarViewGtk; | 34 class LocationBarViewGtk; |
| 36 class Profile; | 35 class Profile; |
| 37 class ReloadButtonGtk; | 36 class ReloadButtonGtk; |
| 38 class TabContents; | 37 class TabContents; |
| 39 class ToolbarModel; | 38 class ToolbarModel; |
| 40 | 39 |
| 41 // View class that displays the GTK version of the toolbar and routes gtk | 40 // View class that displays the GTK version of the toolbar and routes gtk |
| 42 // events back to the Browser. | 41 // events back to the Browser. |
| 43 class BrowserToolbarGtk : public CommandUpdater::CommandObserver, | 42 class BrowserToolbarGtk : public CommandUpdater::CommandObserver, |
| 44 public menus::AcceleratorProvider, | 43 public menus::SimpleMenuModel::Delegate, |
| 45 public MenuGtk::Delegate, | 44 public MenuGtk::Delegate, |
| 46 public NotificationObserver, | 45 public NotificationObserver, |
| 47 public AnimationDelegate, | 46 public AnimationDelegate, |
| 48 public ActiveWindowWatcherX::Observer { | 47 public ActiveWindowWatcherX::Observer { |
| 49 public: | 48 public: |
| 50 explicit BrowserToolbarGtk(Browser* browser, BrowserWindowGtk* window); | 49 explicit BrowserToolbarGtk(Browser* browser, BrowserWindowGtk* window); |
| 51 virtual ~BrowserToolbarGtk(); | 50 virtual ~BrowserToolbarGtk(); |
| 52 | 51 |
| 53 // Create the contents of the toolbar. |top_level_window| is the GtkWindow | 52 // Create the contents of the toolbar. |top_level_window| is the GtkWindow |
| 54 // to which we attach our accelerators. | 53 // to which we attach our accelerators. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 87 |
| 89 void ShowAppMenu(); | 88 void ShowAppMenu(); |
| 90 | 89 |
| 91 // Overridden from CommandUpdater::CommandObserver: | 90 // Overridden from CommandUpdater::CommandObserver: |
| 92 virtual void EnabledStateChangedForCommand(int id, bool enabled); | 91 virtual void EnabledStateChangedForCommand(int id, bool enabled); |
| 93 | 92 |
| 94 // Overridden from MenuGtk::Delegate: | 93 // Overridden from MenuGtk::Delegate: |
| 95 virtual void StoppedShowing(); | 94 virtual void StoppedShowing(); |
| 96 virtual GtkIconSet* GetIconSetForId(int idr); | 95 virtual GtkIconSet* GetIconSetForId(int idr); |
| 97 | 96 |
| 98 // Overridden from menus::AcceleratorProvider: | 97 // Overridden from menus::SimpleMenuModel::Delegate: |
| 98 virtual bool IsCommandIdEnabled(int id) const; |
| 99 virtual bool IsCommandIdChecked(int id) const; |
| 100 virtual void ExecuteCommand(int id); |
| 99 virtual bool GetAcceleratorForCommandId(int id, | 101 virtual bool GetAcceleratorForCommandId(int id, |
| 100 menus::Accelerator* accelerator); | 102 menus::Accelerator* accelerator); |
| 101 | 103 |
| 102 // NotificationObserver implementation. | 104 // NotificationObserver implementation. |
| 103 void Observe(NotificationType type, | 105 void Observe(NotificationType type, |
| 104 const NotificationSource& source, | 106 const NotificationSource& source, |
| 105 const NotificationDetails& details); | 107 const NotificationDetails& details); |
| 106 | 108 |
| 107 Profile* profile() { return profile_; } | 109 Profile* profile() { return profile_; } |
| 108 void SetProfile(Profile* profile); | 110 void SetProfile(Profile* profile); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 235 |
| 234 ThrobAnimation upgrade_reminder_animation_; | 236 ThrobAnimation upgrade_reminder_animation_; |
| 235 | 237 |
| 236 // We have already shown and dismissed the upgrade reminder animation. | 238 // We have already shown and dismissed the upgrade reminder animation. |
| 237 bool upgrade_reminder_canceled_; | 239 bool upgrade_reminder_canceled_; |
| 238 | 240 |
| 239 DISALLOW_COPY_AND_ASSIGN(BrowserToolbarGtk); | 241 DISALLOW_COPY_AND_ASSIGN(BrowserToolbarGtk); |
| 240 }; | 242 }; |
| 241 | 243 |
| 242 #endif // CHROME_BROWSER_GTK_BROWSER_TOOLBAR_GTK_H_ | 244 #endif // CHROME_BROWSER_GTK_BROWSER_TOOLBAR_GTK_H_ |
| OLD | NEW |