Chromium Code Reviews| 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 <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 Loading... | |
| 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 Loading... | |
| 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 |
| 136 const content::NotificationDetails& details) override; | 137 // UpgradeObserver implementation. |
|
sky
2017/06/07 23:01:41
Similar comment about merging.
weidongg
2017/06/08 02:28:42
Done.
| |
| 138 void OnOutdatedInstallNoAU() override; | |
| 139 | |
| 140 #if defined(OS_WIN) | |
| 141 // UpgradeObserver implementation. | |
| 142 void OnCriticalUpgradeInstalled() override; | |
|
sky
2017/06/07 23:01:41
How about always overriding this function, and mov
weidongg
2017/06/08 02:28:42
Done.
| |
| 143 #endif | |
| 137 | 144 |
| 138 // ui::AcceleratorProvider: | 145 // ui::AcceleratorProvider: |
| 139 bool GetAcceleratorForCommandId(int command_id, | 146 bool GetAcceleratorForCommandId(int command_id, |
| 140 ui::Accelerator* accelerator) const override; | 147 ui::Accelerator* accelerator) const override; |
| 141 | 148 |
| 142 // views::View: | 149 // views::View: |
| 143 gfx::Size CalculatePreferredSize() const override; | 150 gfx::Size CalculatePreferredSize() const override; |
| 144 gfx::Size GetMinimumSize() const override; | 151 gfx::Size GetMinimumSize() const override; |
| 145 void Layout() override; | 152 void Layout() override; |
| 146 void OnThemeChanged() override; | 153 void OnThemeChanged() override; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 203 Browser* browser_; | 210 Browser* browser_; |
| 204 | 211 |
| 205 AppMenuIconController app_menu_icon_controller_; | 212 AppMenuIconController app_menu_icon_controller_; |
| 206 | 213 |
| 207 // Controls whether or not a home button should be shown on the toolbar. | 214 // Controls whether or not a home button should be shown on the toolbar. |
| 208 BooleanPrefMember show_home_button_; | 215 BooleanPrefMember show_home_button_; |
| 209 | 216 |
| 210 // The display mode used when laying out the toolbar. | 217 // The display mode used when laying out the toolbar. |
| 211 const DisplayMode display_mode_; | 218 const DisplayMode display_mode_; |
| 212 | 219 |
| 213 content::NotificationRegistrar registrar_; | |
| 214 | |
| 215 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); | 220 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); |
| 216 }; | 221 }; |
| 217 | 222 |
| 218 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ | 223 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ |
| OLD | NEW |