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 // ViewEventTestBase implementation. | 63 // ViewEventTestBase implementation. |
64 virtual void SetUp() OVERRIDE; | 64 virtual void SetUp() OVERRIDE; |
65 virtual void TearDown() OVERRIDE; | 65 virtual void TearDown() OVERRIDE; |
66 virtual views::View* CreateContentsView() OVERRIDE; | 66 virtual views::View* CreateContentsView() OVERRIDE; |
67 virtual void DoTestOnMessageLoop() OVERRIDE; | 67 virtual void DoTestOnMessageLoop() OVERRIDE; |
68 virtual gfx::Size GetPreferredSize() OVERRIDE; | 68 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
69 | 69 |
70 // views::MenuButtonListener implementation | 70 // views::MenuButtonListener implementation |
71 virtual void OnMenuButtonClicked(views::View* source, | 71 virtual void OnMenuButtonClicked(views::View* source, |
72 const gfx::Point& point) OVERRIDE; | 72 const gfx::Point& point) OVERRIDE; |
73 | 73 |
74 // views::MenuDelegate implementation | 74 // views::MenuDelegate implementation |
75 virtual void ExecuteCommand(int id) OVERRIDE; | 75 virtual void ExecuteCommand(int id) OVERRIDE; |
76 | 76 |
77 private: | 77 private: |
78 views::MenuButton* button_; | 78 views::MenuButton* button_; |
79 views::MenuItemView* menu_; | 79 views::MenuItemView* menu_; |
80 scoped_ptr<views::MenuRunner> menu_runner_; | 80 scoped_ptr<views::MenuRunner> menu_runner_; |
81 | 81 |
82 // The command id of the last pressed menu item since the menu was opened. | 82 // The command id of the last pressed menu item since the menu was opened. |
83 int last_command_; | 83 int last_command_; |
84 | 84 |
85 DISALLOW_COPY_AND_ASSIGN(MenuTestBase); | 85 DISALLOW_COPY_AND_ASSIGN(MenuTestBase); |
86 }; | 86 }; |
87 | 87 |
88 #endif // CHROME_BROWSER_UI_VIEWS_MENU_TEST_BASE_H_ | 88 #endif // CHROME_BROWSER_UI_VIEWS_MENU_TEST_BASE_H_ |
OLD | NEW |