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 #ifndef CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_ | 6 #define CHROME_BROWSER_UI_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 "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
13 #include "chrome/browser/command_updater.h" | 14 #include "chrome/browser/command_updater.h" |
14 #include "chrome/browser/prefs/pref_member.h" | 15 #include "chrome/browser/prefs/pref_member.h" |
15 #include "chrome/browser/ui/gtk/custom_button.h" | 16 #include "chrome/browser/ui/gtk/custom_button.h" |
16 #include "chrome/browser/ui/gtk/menu_gtk.h" | 17 #include "chrome/browser/ui/gtk/menu_gtk.h" |
17 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" | 18 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" |
18 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
19 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
20 #include "ui/base/gtk/gtk_signal.h" | 21 #include "ui/base/gtk/gtk_signal.h" |
21 #include "ui/base/gtk/gtk_signal_registrar.h" | 22 #include "ui/base/gtk/gtk_signal_registrar.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 78 |
78 LocationBarViewGtk* GetLocationBarView() { return location_bar_.get(); } | 79 LocationBarViewGtk* GetLocationBarView() { return location_bar_.get(); } |
79 | 80 |
80 // We have to show padding on the bottom of the toolbar when the bookmark | 81 // We have to show padding on the bottom of the toolbar when the bookmark |
81 // is in floating mode. Otherwise the bookmark bar will paint it for us. | 82 // is in floating mode. Otherwise the bookmark bar will paint it for us. |
82 void UpdateForBookmarkBarVisibility(bool show_bottom_padding); | 83 void UpdateForBookmarkBarVisibility(bool show_bottom_padding); |
83 | 84 |
84 void ShowAppMenu(); | 85 void ShowAppMenu(); |
85 | 86 |
86 // Overridden from CommandUpdater::CommandObserver: | 87 // Overridden from CommandUpdater::CommandObserver: |
87 virtual void EnabledStateChangedForCommand(int id, bool enabled); | 88 virtual void EnabledStateChangedForCommand(int id, bool enabled) OVERRIDE; |
88 | 89 |
89 // Overridden from MenuGtk::Delegate: | 90 // Overridden from MenuGtk::Delegate: |
90 virtual void StoppedShowing(); | 91 virtual void StoppedShowing() OVERRIDE; |
91 virtual GtkIconSet* GetIconSetForId(int idr); | 92 virtual GtkIconSet* GetIconSetForId(int idr) OVERRIDE; |
92 virtual bool AlwaysShowIconForCmd(int command_id) const; | 93 virtual bool AlwaysShowIconForCmd(int command_id) const OVERRIDE; |
93 | 94 |
94 // Overridden from ui::AcceleratorProvider: | 95 // Overridden from ui::AcceleratorProvider: |
95 virtual bool GetAcceleratorForCommandId(int id, | 96 virtual bool GetAcceleratorForCommandId( |
96 ui::Accelerator* accelerator); | 97 int id, |
| 98 ui::Accelerator* accelerator) OVERRIDE; |
97 | 99 |
98 // content::NotificationObserver implementation. | 100 // content::NotificationObserver implementation. |
99 virtual void Observe(int type, | 101 virtual void Observe(int type, |
100 const content::NotificationSource& source, | 102 const content::NotificationSource& source, |
101 const content::NotificationDetails& details); | 103 const content::NotificationDetails& details) OVERRIDE; |
102 | 104 |
103 // Message that we should react to a state change. | 105 // Message that we should react to a state change. |
104 void UpdateTabContents(TabContents* contents, bool should_restore_state); | 106 void UpdateTabContents(TabContents* contents, bool should_restore_state); |
105 | 107 |
106 private: | 108 private: |
107 // Connect/Disconnect signals for dragging a url onto the home button. | 109 // Connect/Disconnect signals for dragging a url onto the home button. |
108 void SetUpDragForHomeButton(bool enable); | 110 void SetUpDragForHomeButton(bool enable); |
109 | 111 |
110 // Sets the top corners of the toolbar to rounded, or sets them to normal, | 112 // Sets the top corners of the toolbar to rounded, or sets them to normal, |
111 // depending on the state of the browser window. Returns false if no action | 113 // depending on the state of the browser window. Returns false if no action |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // rendering. | 212 // rendering. |
211 ui::OwnedWidgetGtk offscreen_entry_; | 213 ui::OwnedWidgetGtk offscreen_entry_; |
212 | 214 |
213 // Manages the home button drop signal handler. | 215 // Manages the home button drop signal handler. |
214 scoped_ptr<ui::GtkSignalRegistrar> drop_handler_; | 216 scoped_ptr<ui::GtkSignalRegistrar> drop_handler_; |
215 | 217 |
216 DISALLOW_COPY_AND_ASSIGN(BrowserToolbarGtk); | 218 DISALLOW_COPY_AND_ASSIGN(BrowserToolbarGtk); |
217 }; | 219 }; |
218 | 220 |
219 #endif // CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_ | 221 #endif // CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_ |
OLD | NEW |