Chromium Code Reviews

Side by Side Diff: views/controls/menu/native_menu_x.h

Issue 5110011: A non-GTK version of menus for touchui. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2010 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_X_H_
6 #define VIEWS_CONTROLS_MENU_NATIVE_MENU_X_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 menus {
14 class MenuModel;
15 }
16
17 namespace views {
18
19 class NativeMenuX : public MenuWrapper,
sky 2010/11/22 17:06:15 Description?
20 public MenuDelegate {
sky 2010/11/22 17:06:15 indentation is off.
sadrul 2010/11/22 18:48:22 Fixed, and added a description.
21 public:
22 explicit NativeMenuX(Menu2* menu);
23 virtual ~NativeMenuX();
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, menus::MenuModel* model);
44 void UpdateMenuFromModel(SubmenuView* menu, menus::MenuModel* model);
45
46 menus::MenuModel* model_;
sky 2010/11/22 17:06:15 Document ownership.
sadrul 2010/11/22 18:48:22 Done.
47 MenuItemView* root_;
48
49 DISALLOW_COPY_AND_ASSIGN(NativeMenuX);
50 };
51
52 } // namespace views
53
54 #endif // VIEWS_CONTROLS_MENU_NATIVE_MENU_X_H_
OLDNEW

Powered by Google App Engine