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