OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CHROMEOS_DOM_UI_DOMUI_MENU_CONTROL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_WEBUI_MENU_CONTROL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DOM_UI_DOMUI_MENU_CONTROL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_WEBUI_MENU_CONTROL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 namespace gfx { | 9 namespace gfx { |
10 class Size; | 10 class Size; |
11 } // namespace gfx | 11 } // namespace gfx |
12 | 12 |
13 namespace ui { | 13 namespace ui { |
14 class MenuModel; | 14 class MenuModel; |
15 } // namespace ui | 15 } // namespace ui |
16 | 16 |
17 namespace chromeos { | 17 namespace chromeos { |
18 | 18 |
19 // DOMUIMenuControl class is used to control the UI counterpart of | 19 // WebUIMenuControl class is used to control the UI counterpart of |
20 // a MenuModel. One instance of DOMUIMenuControl is created for each | 20 // a MenuModel. One instance of WebUIMenuControl is created for each |
21 // MenuModel instance, that is, a submenu will have its own | 21 // MenuModel instance, that is, a submenu will have its own |
22 // DOMUIMenuControl. | 22 // WebUIMenuControl. |
23 class DOMUIMenuControl { | 23 class WebUIMenuControl { |
24 public: | 24 public: |
25 enum ActivationMode { | 25 enum ActivationMode { |
26 ACTIVATE_NO_CLOSE, // Activate the command without closing menu. | 26 ACTIVATE_NO_CLOSE, // Activate the command without closing menu. |
27 CLOSE_AND_ACTIVATE, // Close the menu and then activate the command. | 27 CLOSE_AND_ACTIVATE, // Close the menu and then activate the command. |
28 }; | 28 }; |
29 virtual ~DOMUIMenuControl() {} | 29 virtual ~WebUIMenuControl() {} |
30 | 30 |
31 // Returns the MenuModel associated with this control. | 31 // Returns the MenuModel associated with this control. |
32 virtual ui::MenuModel* GetMenuModel() = 0; | 32 virtual ui::MenuModel* GetMenuModel() = 0; |
33 | 33 |
34 // Activates an item in the |model| at |index|. | 34 // Activates an item in the |model| at |index|. |
35 virtual void Activate(ui::MenuModel* model, | 35 virtual void Activate(ui::MenuModel* model, |
36 int index, | 36 int index, |
37 ActivationMode activation_mode) = 0; | 37 ActivationMode activation_mode) = 0; |
38 | 38 |
39 // Close All menu window from root menu to leaf submenus. | 39 // Close All menu window from root menu to leaf submenus. |
(...skipping 16 matching lines...) Expand all Loading... |
56 // The top coordinate of the selected menu is passed as |y_top| | 56 // The top coordinate of the selected menu is passed as |y_top| |
57 // so that the submenu can be aligned to the selected item. | 57 // so that the submenu can be aligned to the selected item. |
58 virtual void OpenSubmenu(int index, int y_top) =0; | 58 virtual void OpenSubmenu(int index, int y_top) =0; |
59 | 59 |
60 // Sets the size of the menu. | 60 // Sets the size of the menu. |
61 virtual void SetSize(const gfx::Size& size) = 0; | 61 virtual void SetSize(const gfx::Size& size) = 0; |
62 }; | 62 }; |
63 | 63 |
64 } // namespace chromeos | 64 } // namespace chromeos |
65 | 65 |
66 #endif // CHROME_BROWSER_CHROMEOS_DOM_UI_DOMUI_MENU_CONTROL_H_ | 66 #endif // CHROME_BROWSER_CHROMEOS_WEBUI_MENU_CONTROL_H_ |
OLD | NEW |