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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
13 #include "base/prefs/pref_member.h" | 13 #include "base/prefs/pref_member.h" |
14 #include "chrome/browser/command_observer.h" | 14 #include "chrome/browser/command_observer.h" |
15 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" | 15 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" |
16 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 16 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
17 #include "ui/base/accelerators/accelerator.h" | 17 #include "ui/base/accelerators/accelerator.h" |
18 #include "ui/views/accessible_pane_view.h" | 18 #include "ui/views/accessible_pane_view.h" |
19 #include "ui/views/controls/button/menu_button.h" | 19 #include "ui/views/controls/button/menu_button.h" |
20 #include "ui/views/controls/button/menu_button_listener.h" | 20 #include "ui/views/controls/button/menu_button_listener.h" |
21 #include "ui/views/view.h" | 21 #include "ui/views/view.h" |
22 | 22 |
23 class BackButton; | 23 class BackButton; |
24 class BrowserActionsContainer; | 24 class BrowserActionsContainer; |
25 class Browser; | 25 class Browser; |
26 class HomeButton; | 26 class HomeButton; |
27 class ReloadButton; | 27 class ReloadButton; |
| 28 class SiteChipView; |
28 class ToolbarButton; | 29 class ToolbarButton; |
29 class WrenchMenu; | 30 class WrenchMenu; |
30 class WrenchMenuModel; | 31 class WrenchMenuModel; |
31 class WrenchToolbarButton; | 32 class WrenchToolbarButton; |
32 | 33 |
33 namespace views { | 34 namespace views { |
34 class MenuListener; | 35 class MenuListener; |
35 } | 36 } |
36 | 37 |
37 // The Browser Window's toolbar. | 38 // The Browser Window's toolbar. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 views::View* GetBookmarkBubbleAnchor(); | 80 views::View* GetBookmarkBubbleAnchor(); |
80 | 81 |
81 // Returns the view to which the Translate bubble should be anchored. | 82 // Returns the view to which the Translate bubble should be anchored. |
82 views::View* GetTranslateBubbleAnchor(); | 83 views::View* GetTranslateBubbleAnchor(); |
83 | 84 |
84 // Accessors... | 85 // Accessors... |
85 Browser* browser() const { return browser_; } | 86 Browser* browser() const { return browser_; } |
86 BrowserActionsContainer* browser_actions() const { return browser_actions_; } | 87 BrowserActionsContainer* browser_actions() const { return browser_actions_; } |
87 ReloadButton* reload_button() const { return reload_; } | 88 ReloadButton* reload_button() const { return reload_; } |
88 LocationBarView* location_bar() const { return location_bar_; } | 89 LocationBarView* location_bar() const { return location_bar_; } |
| 90 SiteChipView* site_chip() const { return site_chip_view_; } |
89 views::MenuButton* app_menu() const; | 91 views::MenuButton* app_menu() const; |
90 | 92 |
91 // Overridden from AccessiblePaneView | 93 // Overridden from AccessiblePaneView |
92 virtual bool SetPaneFocus(View* initial_focus) OVERRIDE; | 94 virtual bool SetPaneFocus(View* initial_focus) OVERRIDE; |
93 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 95 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
94 | 96 |
95 // Overridden from views::MenuButtonListener: | 97 // Overridden from views::MenuButtonListener: |
96 virtual void OnMenuButtonClicked(views::View* source, | 98 virtual void OnMenuButtonClicked(views::View* source, |
97 const gfx::Point& point) OVERRIDE; | 99 const gfx::Point& point) OVERRIDE; |
98 | 100 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 void OnShowHomeButtonChanged(); | 212 void OnShowHomeButtonChanged(); |
211 | 213 |
212 int content_shadow_height() const; | 214 int content_shadow_height() const; |
213 | 215 |
214 // Controls | 216 // Controls |
215 BackButton* back_; | 217 BackButton* back_; |
216 ToolbarButton* forward_; | 218 ToolbarButton* forward_; |
217 ReloadButton* reload_; | 219 ReloadButton* reload_; |
218 HomeButton* home_; | 220 HomeButton* home_; |
219 LocationBarView* location_bar_; | 221 LocationBarView* location_bar_; |
| 222 SiteChipView* site_chip_view_; |
220 BrowserActionsContainer* browser_actions_; | 223 BrowserActionsContainer* browser_actions_; |
221 WrenchToolbarButton* app_menu_; | 224 WrenchToolbarButton* app_menu_; |
222 Browser* browser_; | 225 Browser* browser_; |
223 | 226 |
224 // Controls whether or not a home button should be shown on the toolbar. | 227 // Controls whether or not a home button should be shown on the toolbar. |
225 BooleanPrefMember show_home_button_; | 228 BooleanPrefMember show_home_button_; |
226 | 229 |
227 // The display mode used when laying out the toolbar. | 230 // The display mode used when laying out the toolbar. |
228 DisplayMode display_mode_; | 231 DisplayMode display_mode_; |
229 | 232 |
230 // Wrench model and menu. | 233 // Wrench model and menu. |
231 // Note that the menu should be destroyed before the model it uses, so the | 234 // Note that the menu should be destroyed before the model it uses, so the |
232 // menu should be listed later. | 235 // menu should be listed later. |
233 scoped_ptr<WrenchMenuModel> wrench_menu_model_; | 236 scoped_ptr<WrenchMenuModel> wrench_menu_model_; |
234 scoped_ptr<WrenchMenu> wrench_menu_; | 237 scoped_ptr<WrenchMenu> wrench_menu_; |
235 | 238 |
236 // A list of listeners to call when the menu opens. | 239 // A list of listeners to call when the menu opens. |
237 ObserverList<views::MenuListener> menu_listeners_; | 240 ObserverList<views::MenuListener> menu_listeners_; |
238 | 241 |
239 content::NotificationRegistrar registrar_; | 242 content::NotificationRegistrar registrar_; |
240 | 243 |
241 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); | 244 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); |
242 }; | 245 }; |
243 | 246 |
244 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ | 247 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ |
OLD | NEW |