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

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

Issue 2925973002: Migrate upgrade notifications to observer (Closed)
Patch Set: Add DISALLOW_COPY_AND_ASSIGN Created 3 years, 6 months 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
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 <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/observer_list.h" 11 #include "base/observer_list.h"
12 #include "chrome/browser/command_observer.h" 12 #include "chrome/browser/command_observer.h"
13 #include "chrome/browser/ui/toolbar/app_menu_icon_controller.h" 13 #include "chrome/browser/ui/toolbar/app_menu_icon_controller.h"
14 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" 14 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h"
15 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 15 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
16 #include "chrome/browser/upgrade_observer.h"
16 #include "components/prefs/pref_member.h" 17 #include "components/prefs/pref_member.h"
17 #include "components/translate/core/browser/translate_step.h" 18 #include "components/translate/core/browser/translate_step.h"
18 #include "components/translate/core/common/translate_errors.h" 19 #include "components/translate/core/common/translate_errors.h"
19 #include "ui/base/accelerators/accelerator.h" 20 #include "ui/base/accelerators/accelerator.h"
20 #include "ui/views/accessible_pane_view.h" 21 #include "ui/views/accessible_pane_view.h"
21 #include "ui/views/controls/button/menu_button.h" 22 #include "ui/views/controls/button/menu_button.h"
22 #include "ui/views/controls/button/menu_button_listener.h" 23 #include "ui/views/controls/button/menu_button_listener.h"
23 #include "ui/views/view.h" 24 #include "ui/views/view.h"
24 25
25 class AppMenuButton; 26 class AppMenuButton;
(...skipping 10 matching lines...) Expand all
36 37
37 namespace bookmarks { 38 namespace bookmarks {
38 class BookmarkBubbleObserver; 39 class BookmarkBubbleObserver;
39 } 40 }
40 41
41 // The Browser Window's toolbar. 42 // The Browser Window's toolbar.
42 class ToolbarView : public views::AccessiblePaneView, 43 class ToolbarView : public views::AccessiblePaneView,
43 public views::MenuButtonListener, 44 public views::MenuButtonListener,
44 public ui::AcceleratorProvider, 45 public ui::AcceleratorProvider,
45 public LocationBarView::Delegate, 46 public LocationBarView::Delegate,
46 public content::NotificationObserver,
47 public CommandObserver, 47 public CommandObserver,
48 public views::ButtonListener, 48 public views::ButtonListener,
49 public AppMenuIconController::Delegate { 49 public AppMenuIconController::Delegate,
50 public UpgradeObserver {
50 public: 51 public:
51 // The view class name. 52 // The view class name.
52 static const char kViewClassName[]; 53 static const char kViewClassName[];
53 54
54 explicit ToolbarView(Browser* browser); 55 explicit ToolbarView(Browser* browser);
55 ~ToolbarView() override; 56 ~ToolbarView() override;
56 57
57 // Create the contents of the Browser Toolbar. 58 // Create the contents of the Browser Toolbar.
58 void Init(); 59 void Init();
59 60
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 ContentSettingBubbleModelDelegate* GetContentSettingBubbleModelDelegate() 124 ContentSettingBubbleModelDelegate* GetContentSettingBubbleModelDelegate()
124 override; 125 override;
125 void ShowPageInfo(content::WebContents* web_contents) override; 126 void ShowPageInfo(content::WebContents* web_contents) override;
126 127
127 // CommandObserver: 128 // CommandObserver:
128 void EnabledStateChangedForCommand(int id, bool enabled) override; 129 void EnabledStateChangedForCommand(int id, bool enabled) override;
129 130
130 // views::ButtonListener: 131 // views::ButtonListener:
131 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 132 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
132 133
133 // content::NotificationObserver: 134 // UpgradeObserver implementation.
134 void Observe(int type, 135 void OnOutdatedInstall() override;
135 const content::NotificationSource& source, 136 void OnOutdatedInstallNoAutoUpdate() override;
136 const content::NotificationDetails& details) override; 137 void OnCriticalUpgradeInstalled() override;
137 138
138 // ui::AcceleratorProvider: 139 // ui::AcceleratorProvider:
139 bool GetAcceleratorForCommandId(int command_id, 140 bool GetAcceleratorForCommandId(int command_id,
140 ui::Accelerator* accelerator) const override; 141 ui::Accelerator* accelerator) const override;
141 142
142 // views::View: 143 // views::View:
143 gfx::Size CalculatePreferredSize() const override; 144 gfx::Size CalculatePreferredSize() const override;
144 gfx::Size GetMinimumSize() const override; 145 gfx::Size GetMinimumSize() const override;
145 void Layout() override; 146 void Layout() override;
146 void OnThemeChanged() override; 147 void OnThemeChanged() override;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 Browser* browser_; 204 Browser* browser_;
204 205
205 AppMenuIconController app_menu_icon_controller_; 206 AppMenuIconController app_menu_icon_controller_;
206 207
207 // Controls whether or not a home button should be shown on the toolbar. 208 // Controls whether or not a home button should be shown on the toolbar.
208 BooleanPrefMember show_home_button_; 209 BooleanPrefMember show_home_button_;
209 210
210 // The display mode used when laying out the toolbar. 211 // The display mode used when laying out the toolbar.
211 const DisplayMode display_mode_; 212 const DisplayMode display_mode_;
212 213
213 content::NotificationRegistrar registrar_;
214
215 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); 214 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView);
216 }; 215 };
217 216
218 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ 217 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/app_menu_model_unittest.cc ('k') | chrome/browser/ui/views/toolbar/toolbar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698