OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef VIEWS_CONTROLS_MENU_NATIVE_MENU_WAYLAND_H_ | |
sadrul
2011/08/15 14:50:23
Is there anything wayland-y in here? Or can you co
| |
6 #define VIEWS_CONTROLS_MENU_NATIVE_MENU_WAYLAND_H_ | |
7 #pragma once | |
8 | |
9 #include "views/controls/menu/menu_delegate.h" | |
10 #include "views/controls/menu/menu_item_view.h" | |
11 #include "views/controls/menu/menu_wrapper.h" | |
12 | |
13 namespace ui { | |
14 class MenuModel; | |
15 } | |
16 | |
17 namespace views { | |
18 | |
19 class NativeMenuWayland : public MenuWrapper, | |
20 public MenuDelegate { | |
21 public: | |
22 explicit NativeMenuWayland(Menu2* menu); | |
23 virtual ~NativeMenuWayland(); | |
24 | |
25 // Overridden from MenuWrapper: | |
26 virtual void RunMenuAt(const gfx::Point& point, int alignment); | |
27 virtual void CancelMenu(); | |
28 virtual void Rebuild(); | |
29 virtual void UpdateStates(); | |
30 virtual gfx::NativeMenu GetNativeMenu() const; | |
31 virtual MenuAction GetMenuAction() const; | |
32 virtual void AddMenuListener(MenuListener* listener); | |
33 virtual void RemoveMenuListener(MenuListener* listener); | |
34 virtual void SetMinimumWidth(int width); | |
35 | |
36 // Overridden from MenuDelegate: | |
37 virtual bool IsItemChecked(int id) const; | |
38 virtual bool IsCommandEnabled(int id) const; | |
39 virtual void ExecuteCommand(int id); | |
40 virtual bool GetAccelerator(int id, views::Accelerator* accelerator); | |
41 | |
42 private: | |
43 void AddMenuItemsFromModel(MenuItemView* parent, ui::MenuModel* model); | |
44 void UpdateMenuFromModel(SubmenuView* menu, ui::MenuModel* model); | |
45 | |
46 // The attached model and delegate. Does not assume ownership. | |
47 ui::MenuModel* model_; | |
48 scoped_ptr<MenuItemView> root_; | |
49 | |
50 DISALLOW_COPY_AND_ASSIGN(NativeMenuWayland); | |
51 }; | |
52 | |
53 } // namespace views | |
54 | |
55 #endif // VIEWS_CONTROLS_MENU_NATIVE_MENU_WAYLAND_H_ | |
OLD | NEW |