Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(544)

Side by Side Diff: chrome/browser/ui/views/toolbar/toolbar_view.h

Issue 75873002: [SiteChip] Add the basic painting of the site chip button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move painter, etc. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 virtual bool AcceleratorPressed(const ui::Accelerator& acc) OVERRIDE; 149 virtual bool AcceleratorPressed(const ui::Accelerator& acc) OVERRIDE;
148 150
149 // Whether the wrench/hotdogs menu is currently showing. 151 // Whether the wrench/hotdogs menu is currently showing.
150 bool IsWrenchMenuShowing() const; 152 bool IsWrenchMenuShowing() const;
151 153
152 // Whether the toolbar view needs its background painted by the 154 // Whether the toolbar view needs its background painted by the
153 // BrowserNonClientFrameView. 155 // BrowserNonClientFrameView.
154 bool ShouldPaintBackground() const; 156 bool ShouldPaintBackground() const;
155 157
156 enum { 158 enum {
159 // The apparent horizontal space around the site chip.
Peter Kasting 2013/12/03 23:04:52 Based on my comments on the bug: we should nuke th
Greg Billock 2013/12/04 00:33:34 Done.
160 kSiteChipSpacing = 2,
161
157 // The apparent horizontal space between most items, and the vertical 162 // The apparent horizontal space between most items, and the vertical
158 // padding above and below them. 163 // padding above and below them.
159 kStandardSpacing = 3, 164 kStandardSpacing = 3,
160 165
161 // The top of the toolbar has an edge we have to skip over in addition to 166 // The top of the toolbar has an edge we have to skip over in addition to
162 // the standard spacing. 167 // the standard spacing.
163 kVertSpacing = 5, 168 kVertSpacing = 5,
164 }; 169 };
165 170
166 protected: 171 protected:
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 void OnShowHomeButtonChanged(); 215 void OnShowHomeButtonChanged();
211 216
212 int content_shadow_height() const; 217 int content_shadow_height() const;
213 218
214 // Controls 219 // Controls
215 BackButton* back_; 220 BackButton* back_;
216 ToolbarButton* forward_; 221 ToolbarButton* forward_;
217 ReloadButton* reload_; 222 ReloadButton* reload_;
218 HomeButton* home_; 223 HomeButton* home_;
219 LocationBarView* location_bar_; 224 LocationBarView* location_bar_;
225 SiteChipView* site_chip_view_;
220 BrowserActionsContainer* browser_actions_; 226 BrowserActionsContainer* browser_actions_;
221 WrenchToolbarButton* app_menu_; 227 WrenchToolbarButton* app_menu_;
222 Browser* browser_; 228 Browser* browser_;
223 229
224 // Controls whether or not a home button should be shown on the toolbar. 230 // Controls whether or not a home button should be shown on the toolbar.
225 BooleanPrefMember show_home_button_; 231 BooleanPrefMember show_home_button_;
226 232
227 // The display mode used when laying out the toolbar. 233 // The display mode used when laying out the toolbar.
228 DisplayMode display_mode_; 234 DisplayMode display_mode_;
229 235
230 // Wrench model and menu. 236 // Wrench model and menu.
231 // Note that the menu should be destroyed before the model it uses, so the 237 // Note that the menu should be destroyed before the model it uses, so the
232 // menu should be listed later. 238 // menu should be listed later.
233 scoped_ptr<WrenchMenuModel> wrench_menu_model_; 239 scoped_ptr<WrenchMenuModel> wrench_menu_model_;
234 scoped_ptr<WrenchMenu> wrench_menu_; 240 scoped_ptr<WrenchMenu> wrench_menu_;
235 241
236 // A list of listeners to call when the menu opens. 242 // A list of listeners to call when the menu opens.
237 ObserverList<views::MenuListener> menu_listeners_; 243 ObserverList<views::MenuListener> menu_listeners_;
238 244
239 content::NotificationRegistrar registrar_; 245 content::NotificationRegistrar registrar_;
240 246
241 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); 247 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView);
242 }; 248 };
243 249
244 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ 250 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698