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_RELOAD_BUTTON_H__ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_RELOAD_BUTTON_H__ |
6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_RELOAD_BUTTON_H__ | 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_RELOAD_BUTTON_H__ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 // Ask for a specified button state. If |force| is true this will be applied | 40 // Ask for a specified button state. If |force| is true this will be applied |
41 // immediately. | 41 // immediately. |
42 void ChangeMode(Mode mode, bool force); | 42 void ChangeMode(Mode mode, bool force); |
43 | 43 |
44 // Enable reload drop-down menu. | 44 // Enable reload drop-down menu. |
45 void set_menu_enabled(bool enable) { menu_enabled_ = enable; } | 45 void set_menu_enabled(bool enable) { menu_enabled_ = enable; } |
46 | 46 |
47 void LoadImages(); | 47 void LoadImages(); |
48 | 48 |
49 // ToolbarButton: | 49 // ToolbarButton: |
50 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 50 virtual void OnMouseExited(const ui::MouseEvent& event) override; |
51 virtual bool GetTooltipText(const gfx::Point& p, | 51 virtual bool GetTooltipText(const gfx::Point& p, |
52 base::string16* tooltip) const OVERRIDE; | 52 base::string16* tooltip) const override; |
53 virtual const char* GetClassName() const OVERRIDE; | 53 virtual const char* GetClassName() const override; |
54 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 54 virtual void GetAccessibleState(ui::AXViewState* state) override; |
55 virtual bool ShouldShowMenu() OVERRIDE; | 55 virtual bool ShouldShowMenu() override; |
56 virtual void ShowDropDownMenu(ui::MenuSourceType source_type) OVERRIDE; | 56 virtual void ShowDropDownMenu(ui::MenuSourceType source_type) override; |
57 | 57 |
58 // views::ButtonListener: | 58 // views::ButtonListener: |
59 virtual void ButtonPressed(views::Button* /* button */, | 59 virtual void ButtonPressed(views::Button* /* button */, |
60 const ui::Event& event) OVERRIDE; | 60 const ui::Event& event) override; |
61 | 61 |
62 // ui::SimpleMenuModel::Delegate: | 62 // ui::SimpleMenuModel::Delegate: |
63 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 63 virtual bool IsCommandIdChecked(int command_id) const override; |
64 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 64 virtual bool IsCommandIdEnabled(int command_id) const override; |
65 virtual bool IsCommandIdVisible(int command_id) const OVERRIDE; | 65 virtual bool IsCommandIdVisible(int command_id) const override; |
66 virtual bool GetAcceleratorForCommandId( | 66 virtual bool GetAcceleratorForCommandId( |
67 int command_id, | 67 int command_id, |
68 ui::Accelerator* accelerator) OVERRIDE; | 68 ui::Accelerator* accelerator) override; |
69 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | 69 virtual void ExecuteCommand(int command_id, int event_flags) override; |
70 | 70 |
71 private: | 71 private: |
72 friend class ReloadButtonTest; | 72 friend class ReloadButtonTest; |
73 | 73 |
74 ui::SimpleMenuModel* CreateMenuModel(); | 74 ui::SimpleMenuModel* CreateMenuModel(); |
75 | 75 |
76 void ExecuteBrowserCommand(int command, int event_flags); | 76 void ExecuteBrowserCommand(int command, int event_flags); |
77 void ChangeModeInternal(Mode mode); | 77 void ChangeModeInternal(Mode mode); |
78 | 78 |
79 void OnDoubleClickTimer(); | 79 void OnDoubleClickTimer(); |
(...skipping 23 matching lines...) Expand all Loading... |
103 // True if we should pretend the button is hovered. | 103 // True if we should pretend the button is hovered. |
104 bool testing_mouse_hovered_; | 104 bool testing_mouse_hovered_; |
105 // Increments when we would tell the browser to "reload", so | 105 // Increments when we would tell the browser to "reload", so |
106 // test code can tell whether we did so (as there may be no |browser_|). | 106 // test code can tell whether we did so (as there may be no |browser_|). |
107 int testing_reload_count_; | 107 int testing_reload_count_; |
108 | 108 |
109 DISALLOW_IMPLICIT_CONSTRUCTORS(ReloadButton); | 109 DISALLOW_IMPLICIT_CONSTRUCTORS(ReloadButton); |
110 }; | 110 }; |
111 | 111 |
112 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_RELOAD_BUTTON_H__ | 112 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_RELOAD_BUTTON_H__ |
OLD | NEW |