OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 | 34 |
35 // The Browser Window's toolbar. | 35 // The Browser Window's toolbar. |
36 class ToolbarView : public views::AccessiblePaneView, | 36 class ToolbarView : public views::AccessiblePaneView, |
37 public views::MenuButtonListener, | 37 public views::MenuButtonListener, |
38 public ui::AcceleratorProvider, | 38 public ui::AcceleratorProvider, |
39 public LocationBarView::Delegate, | 39 public LocationBarView::Delegate, |
40 public content::NotificationObserver, | 40 public content::NotificationObserver, |
41 public CommandObserver, | 41 public CommandObserver, |
42 public views::ButtonListener, | 42 public views::ButtonListener, |
43 public views::WidgetObserver, | |
44 public views::ViewTargeterDelegate, | 43 public views::ViewTargeterDelegate, |
45 public AppMenuBadgeController::Delegate { | 44 public AppMenuBadgeController::Delegate { |
46 public: | 45 public: |
47 // The view class name. | 46 // The view class name. |
48 static const char kViewClassName[]; | 47 static const char kViewClassName[]; |
49 | 48 |
50 explicit ToolbarView(Browser* browser); | 49 explicit ToolbarView(Browser* browser); |
51 ~ToolbarView() override; | 50 ~ToolbarView() override; |
52 | 51 |
53 // Create the contents of the Browser Toolbar. | 52 // Create the contents of the Browser Toolbar. |
(...skipping 25 matching lines...) Expand all Loading... |
79 views::View* GetSaveCreditCardBubbleAnchor(); | 78 views::View* GetSaveCreditCardBubbleAnchor(); |
80 | 79 |
81 // Returns the view to which the Translate bubble should be anchored. | 80 // Returns the view to which the Translate bubble should be anchored. |
82 views::View* GetTranslateBubbleAnchor(); | 81 views::View* GetTranslateBubbleAnchor(); |
83 | 82 |
84 // Adds |anchor_view| as an observer of |bubble_widget| to track its | 83 // Adds |anchor_view| as an observer of |bubble_widget| to track its |
85 // visibility. | 84 // visibility. |
86 void OnBubbleCreatedForAnchor(views::View* anchor_view, | 85 void OnBubbleCreatedForAnchor(views::View* anchor_view, |
87 views::Widget* bubble_widget); | 86 views::Widget* bubble_widget); |
88 | 87 |
89 // Executes |command| registered by |extension|. | |
90 void ExecuteExtensionCommand(const extensions::Extension* extension, | |
91 const extensions::Command& command); | |
92 | |
93 // Returns the maximum width the browser actions container can have. | 88 // Returns the maximum width the browser actions container can have. |
94 int GetMaxBrowserActionsWidth() const; | 89 int GetMaxBrowserActionsWidth() const; |
95 | 90 |
96 // Accessors. | 91 // Accessors. |
97 Browser* browser() const { return browser_; } | 92 Browser* browser() const { return browser_; } |
98 BrowserActionsContainer* browser_actions() const { return browser_actions_; } | 93 BrowserActionsContainer* browser_actions() const { return browser_actions_; } |
99 ReloadButton* reload_button() const { return reload_; } | 94 ReloadButton* reload_button() const { return reload_; } |
100 LocationBarView* location_bar() const { return location_bar_; } | 95 LocationBarView* location_bar() const { return location_bar_; } |
101 AppMenuButton* app_menu_button() const { return app_menu_button_; } | 96 AppMenuButton* app_menu_button() const { return app_menu_button_; } |
102 HomeButton* home_button() const { return home_; } | 97 HomeButton* home_button() const { return home_; } |
(...skipping 25 matching lines...) Expand all Loading... |
128 const GURL& url, | 123 const GURL& url, |
129 const security_state::SecurityStateModel::SecurityInfo& security_info) | 124 const security_state::SecurityStateModel::SecurityInfo& security_info) |
130 override; | 125 override; |
131 | 126 |
132 // CommandObserver: | 127 // CommandObserver: |
133 void EnabledStateChangedForCommand(int id, bool enabled) override; | 128 void EnabledStateChangedForCommand(int id, bool enabled) override; |
134 | 129 |
135 // views::ButtonListener: | 130 // views::ButtonListener: |
136 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 131 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
137 | 132 |
138 // views::WidgetObserver: | |
139 void OnWidgetActivationChanged(views::Widget* widget, bool active) override; | |
140 | |
141 // content::NotificationObserver: | 133 // content::NotificationObserver: |
142 void Observe(int type, | 134 void Observe(int type, |
143 const content::NotificationSource& source, | 135 const content::NotificationSource& source, |
144 const content::NotificationDetails& details) override; | 136 const content::NotificationDetails& details) override; |
145 | 137 |
146 // ui::AcceleratorProvider: | 138 // ui::AcceleratorProvider: |
147 bool GetAcceleratorForCommandId(int command_id, | 139 bool GetAcceleratorForCommandId(int command_id, |
148 ui::Accelerator* accelerator) override; | 140 ui::Accelerator* accelerator) override; |
149 | 141 |
150 // views::View: | 142 // views::View: |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 void ShowCriticalNotification(); | 192 void ShowCriticalNotification(); |
201 | 193 |
202 // Shows the outdated install notification bubble against the app menu. | 194 // Shows the outdated install notification bubble against the app menu. |
203 // |auto_update_enabled| is set to true when auto-upate is on. | 195 // |auto_update_enabled| is set to true when auto-upate is on. |
204 void ShowOutdatedInstallNotification(bool auto_update_enabled); | 196 void ShowOutdatedInstallNotification(bool auto_update_enabled); |
205 | 197 |
206 void OnShowHomeButtonChanged(); | 198 void OnShowHomeButtonChanged(); |
207 | 199 |
208 int content_shadow_height() const; | 200 int content_shadow_height() const; |
209 | 201 |
210 // Controls | 202 // Controls. Most of these can be null, e.g. in popup windows. Only |
| 203 // |location_bar_| is guaranteed to exist. |
211 BackButton* back_; | 204 BackButton* back_; |
212 ToolbarButton* forward_; | 205 ToolbarButton* forward_; |
213 ReloadButton* reload_; | 206 ReloadButton* reload_; |
214 HomeButton* home_; | 207 HomeButton* home_; |
215 LocationBarView* location_bar_; | 208 LocationBarView* location_bar_; |
216 BrowserActionsContainer* browser_actions_; | 209 BrowserActionsContainer* browser_actions_; |
217 AppMenuButton* app_menu_button_; | 210 AppMenuButton* app_menu_button_; |
| 211 |
218 Browser* browser_; | 212 Browser* browser_; |
219 | 213 |
220 AppMenuBadgeController badge_controller_; | 214 AppMenuBadgeController badge_controller_; |
221 | 215 |
222 // Controls whether or not a home button should be shown on the toolbar. | 216 // Controls whether or not a home button should be shown on the toolbar. |
223 BooleanPrefMember show_home_button_; | 217 BooleanPrefMember show_home_button_; |
224 | 218 |
225 // The display mode used when laying out the toolbar. | 219 // The display mode used when laying out the toolbar. |
226 DisplayMode display_mode_; | 220 const DisplayMode display_mode_; |
227 | 221 |
228 content::NotificationRegistrar registrar_; | 222 content::NotificationRegistrar registrar_; |
229 | 223 |
230 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); | 224 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); |
231 }; | 225 }; |
232 | 226 |
233 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ | 227 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ |
OLD | NEW |