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 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 // Accessors. | 101 // Accessors. |
102 Browser* browser() const { return browser_; } | 102 Browser* browser() const { return browser_; } |
103 BrowserActionsContainer* browser_actions() const { return browser_actions_; } | 103 BrowserActionsContainer* browser_actions() const { return browser_actions_; } |
104 ReloadButton* reload_button() const { return reload_; } | 104 ReloadButton* reload_button() const { return reload_; } |
105 LocationBarView* location_bar() const { return location_bar_; } | 105 LocationBarView* location_bar() const { return location_bar_; } |
106 views::MenuButton* app_menu() const; | 106 views::MenuButton* app_menu() const; |
107 HomeButton* home_button() const { return home_; } | 107 HomeButton* home_button() const { return home_; } |
108 | 108 |
109 // AccessiblePaneView: | 109 // AccessiblePaneView: |
110 virtual bool SetPaneFocus(View* initial_focus) OVERRIDE; | 110 virtual bool SetPaneFocus(View* initial_focus) override; |
111 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 111 virtual void GetAccessibleState(ui::AXViewState* state) override; |
112 | 112 |
113 // views::MenuButtonListener: | 113 // views::MenuButtonListener: |
114 virtual void OnMenuButtonClicked(views::View* source, | 114 virtual void OnMenuButtonClicked(views::View* source, |
115 const gfx::Point& point) OVERRIDE; | 115 const gfx::Point& point) override; |
116 | 116 |
117 // LocationBarView::Delegate: | 117 // LocationBarView::Delegate: |
118 virtual content::WebContents* GetWebContents() OVERRIDE; | 118 virtual content::WebContents* GetWebContents() override; |
119 virtual ToolbarModel* GetToolbarModel() OVERRIDE; | 119 virtual ToolbarModel* GetToolbarModel() override; |
120 virtual const ToolbarModel* GetToolbarModel() const OVERRIDE; | 120 virtual const ToolbarModel* GetToolbarModel() const override; |
121 virtual InstantController* GetInstant() OVERRIDE; | 121 virtual InstantController* GetInstant() override; |
122 virtual views::Widget* CreateViewsBubble( | 122 virtual views::Widget* CreateViewsBubble( |
123 views::BubbleDelegateView* bubble_delegate) OVERRIDE; | 123 views::BubbleDelegateView* bubble_delegate) override; |
124 virtual PageActionImageView* CreatePageActionImageView( | 124 virtual PageActionImageView* CreatePageActionImageView( |
125 LocationBarView* owner, ExtensionAction* action) OVERRIDE; | 125 LocationBarView* owner, ExtensionAction* action) override; |
126 virtual ContentSettingBubbleModelDelegate* | 126 virtual ContentSettingBubbleModelDelegate* |
127 GetContentSettingBubbleModelDelegate() OVERRIDE; | 127 GetContentSettingBubbleModelDelegate() override; |
128 virtual void ShowWebsiteSettings(content::WebContents* web_contents, | 128 virtual void ShowWebsiteSettings(content::WebContents* web_contents, |
129 const GURL& url, | 129 const GURL& url, |
130 const content::SSLStatus& ssl) OVERRIDE; | 130 const content::SSLStatus& ssl) override; |
131 | 131 |
132 // CommandObserver: | 132 // CommandObserver: |
133 virtual void EnabledStateChangedForCommand(int id, bool enabled) OVERRIDE; | 133 virtual void EnabledStateChangedForCommand(int id, bool enabled) override; |
134 | 134 |
135 // views::ButtonListener: | 135 // views::ButtonListener: |
136 virtual void ButtonPressed(views::Button* sender, | 136 virtual void ButtonPressed(views::Button* sender, |
137 const ui::Event& event) OVERRIDE; | 137 const ui::Event& event) override; |
138 | 138 |
139 // views::WidgetObserver: | 139 // views::WidgetObserver: |
140 virtual void OnWidgetVisibilityChanged(views::Widget* widget, | 140 virtual void OnWidgetVisibilityChanged(views::Widget* widget, |
141 bool visible) OVERRIDE; | 141 bool visible) override; |
142 virtual void OnWidgetActivationChanged(views::Widget* widget, | 142 virtual void OnWidgetActivationChanged(views::Widget* widget, |
143 bool active) OVERRIDE; | 143 bool active) override; |
144 | 144 |
145 // content::NotificationObserver: | 145 // content::NotificationObserver: |
146 virtual void Observe(int type, | 146 virtual void Observe(int type, |
147 const content::NotificationSource& source, | 147 const content::NotificationSource& source, |
148 const content::NotificationDetails& details) OVERRIDE; | 148 const content::NotificationDetails& details) override; |
149 | 149 |
150 // ui::AcceleratorProvider: | 150 // ui::AcceleratorProvider: |
151 virtual bool GetAcceleratorForCommandId( | 151 virtual bool GetAcceleratorForCommandId( |
152 int command_id, ui::Accelerator* accelerator) OVERRIDE; | 152 int command_id, ui::Accelerator* accelerator) override; |
153 | 153 |
154 // views::View: | 154 // views::View: |
155 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 155 virtual gfx::Size GetPreferredSize() const override; |
156 virtual gfx::Size GetMinimumSize() const OVERRIDE; | 156 virtual gfx::Size GetMinimumSize() const override; |
157 virtual void Layout() OVERRIDE; | 157 virtual void Layout() override; |
158 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 158 virtual void OnPaint(gfx::Canvas* canvas) override; |
159 virtual void OnThemeChanged() OVERRIDE; | 159 virtual void OnThemeChanged() override; |
160 virtual const char* GetClassName() const OVERRIDE; | 160 virtual const char* GetClassName() const override; |
161 virtual bool AcceleratorPressed(const ui::Accelerator& acc) OVERRIDE; | 161 virtual bool AcceleratorPressed(const ui::Accelerator& acc) override; |
162 | 162 |
163 // Whether the wrench/hotdogs menu is currently showing. | 163 // Whether the wrench/hotdogs menu is currently showing. |
164 bool IsWrenchMenuShowing() const; | 164 bool IsWrenchMenuShowing() const; |
165 | 165 |
166 // Whether the toolbar view needs its background painted by the | 166 // Whether the toolbar view needs its background painted by the |
167 // BrowserNonClientFrameView. | 167 // BrowserNonClientFrameView. |
168 bool ShouldPaintBackground() const; | 168 bool ShouldPaintBackground() const; |
169 | 169 |
170 enum { | 170 enum { |
171 // The apparent horizontal space between most items, and the vertical | 171 // The apparent horizontal space between most items, and the vertical |
172 // padding above and below them. | 172 // padding above and below them. |
173 kStandardSpacing = 3, | 173 kStandardSpacing = 3, |
174 | 174 |
175 // The top of the toolbar has an edge we have to skip over in addition to | 175 // The top of the toolbar has an edge we have to skip over in addition to |
176 // the standard spacing. | 176 // the standard spacing. |
177 kVertSpacing = 5, | 177 kVertSpacing = 5, |
178 }; | 178 }; |
179 | 179 |
180 protected: | 180 protected: |
181 // AccessiblePaneView: | 181 // AccessiblePaneView: |
182 virtual bool SetPaneFocusAndFocusDefault() OVERRIDE; | 182 virtual bool SetPaneFocusAndFocusDefault() override; |
183 virtual void RemovePaneFocus() OVERRIDE; | 183 virtual void RemovePaneFocus() override; |
184 | 184 |
185 private: | 185 private: |
186 // Types of display mode this toolbar can have. | 186 // Types of display mode this toolbar can have. |
187 enum DisplayMode { | 187 enum DisplayMode { |
188 DISPLAYMODE_NORMAL, // Normal toolbar with buttons, etc. | 188 DISPLAYMODE_NORMAL, // Normal toolbar with buttons, etc. |
189 DISPLAYMODE_LOCATION // Slimline toolbar showing only compact location | 189 DISPLAYMODE_LOCATION // Slimline toolbar showing only compact location |
190 // bar, used for popups. | 190 // bar, used for popups. |
191 }; | 191 }; |
192 | 192 |
193 // views::ViewTargeterDelegate: | 193 // views::ViewTargeterDelegate: |
194 virtual bool DoesIntersectRect(const views::View* target, | 194 virtual bool DoesIntersectRect(const views::View* target, |
195 const gfx::Rect& rect) const OVERRIDE; | 195 const gfx::Rect& rect) const override; |
196 | 196 |
197 // WrenchMenuBadgeController::Delegate: | 197 // WrenchMenuBadgeController::Delegate: |
198 virtual void UpdateBadgeSeverity(WrenchMenuBadgeController::BadgeType type, | 198 virtual void UpdateBadgeSeverity(WrenchMenuBadgeController::BadgeType type, |
199 WrenchIconPainter::Severity severity, | 199 WrenchIconPainter::Severity severity, |
200 bool animate) OVERRIDE; | 200 bool animate) override; |
201 | 201 |
202 // Returns the number of pixels above the location bar in non-normal display. | 202 // Returns the number of pixels above the location bar in non-normal display. |
203 int PopupTopSpacing() const; | 203 int PopupTopSpacing() const; |
204 | 204 |
205 // Given toolbar contents of size |size|, returns the total toolbar size. | 205 // Given toolbar contents of size |size|, returns the total toolbar size. |
206 gfx::Size SizeForContentSize(gfx::Size size) const; | 206 gfx::Size SizeForContentSize(gfx::Size size) const; |
207 | 207 |
208 // Loads the images for all the child views. | 208 // Loads the images for all the child views. |
209 void LoadImages(); | 209 void LoadImages(); |
210 | 210 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 254 |
255 // A list of listeners to call when the menu opens. | 255 // A list of listeners to call when the menu opens. |
256 ObserverList<views::MenuListener> menu_listeners_; | 256 ObserverList<views::MenuListener> menu_listeners_; |
257 | 257 |
258 content::NotificationRegistrar registrar_; | 258 content::NotificationRegistrar registrar_; |
259 | 259 |
260 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); | 260 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); |
261 }; | 261 }; |
262 | 262 |
263 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ | 263 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ |
OLD | NEW |