OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MENU_TEST_BASE_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_MENU_TEST_BASE_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_MENU_TEST_BASE_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_MENU_TEST_BASE_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/test/base/view_event_test_base.h" | 10 #include "chrome/test/base/view_event_test_base.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 virtual void BuildMenu(views::MenuItemView* menu) = 0; | 58 virtual void BuildMenu(views::MenuItemView* menu) = 0; |
59 | 59 |
60 // Called once the menu is open. | 60 // Called once the menu is open. |
61 virtual void DoTestWithMenuOpen() = 0; | 61 virtual void DoTestWithMenuOpen() = 0; |
62 | 62 |
63 // Returns a bitmask of flags to use when creating the |menu_runner_|. By | 63 // Returns a bitmask of flags to use when creating the |menu_runner_|. By |
64 // default, this is only views::MenuRunner::HAS_MNEMONICS. | 64 // default, this is only views::MenuRunner::HAS_MNEMONICS. |
65 virtual int GetMenuRunnerFlags(); | 65 virtual int GetMenuRunnerFlags(); |
66 | 66 |
67 // ViewEventTestBase implementation. | 67 // ViewEventTestBase implementation. |
68 virtual void SetUp() OVERRIDE; | 68 virtual void SetUp() override; |
69 virtual void TearDown() OVERRIDE; | 69 virtual void TearDown() override; |
70 virtual views::View* CreateContentsView() OVERRIDE; | 70 virtual views::View* CreateContentsView() override; |
71 virtual void DoTestOnMessageLoop() OVERRIDE; | 71 virtual void DoTestOnMessageLoop() override; |
72 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 72 virtual gfx::Size GetPreferredSize() const override; |
73 | 73 |
74 // views::MenuButtonListener implementation | 74 // views::MenuButtonListener implementation |
75 virtual void OnMenuButtonClicked(views::View* source, | 75 virtual void OnMenuButtonClicked(views::View* source, |
76 const gfx::Point& point) OVERRIDE; | 76 const gfx::Point& point) override; |
77 | 77 |
78 // views::MenuDelegate implementation | 78 // views::MenuDelegate implementation |
79 virtual void ExecuteCommand(int id) OVERRIDE; | 79 virtual void ExecuteCommand(int id) override; |
80 | 80 |
81 private: | 81 private: |
82 views::MenuButton* button_; | 82 views::MenuButton* button_; |
83 views::MenuItemView* menu_; | 83 views::MenuItemView* menu_; |
84 scoped_ptr<views::MenuRunner> menu_runner_; | 84 scoped_ptr<views::MenuRunner> menu_runner_; |
85 | 85 |
86 // The command id of the last pressed menu item since the menu was opened. | 86 // The command id of the last pressed menu item since the menu was opened. |
87 int last_command_; | 87 int last_command_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(MenuTestBase); | 89 DISALLOW_COPY_AND_ASSIGN(MenuTestBase); |
90 }; | 90 }; |
91 | 91 |
92 #endif // CHROME_BROWSER_UI_VIEWS_MENU_TEST_BASE_H_ | 92 #endif // CHROME_BROWSER_UI_VIEWS_MENU_TEST_BASE_H_ |
OLD | NEW |