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 UI_VIEWS_CONTROLS_MENU_MENU_GTK_H_ | |
6 #define UI_VIEWS_CONTROLS_MENU_MENU_GTK_H_ | |
7 #pragma once | |
8 | |
9 #include "base/basictypes.h" | |
10 #include "base/compiler_specific.h" | |
11 #include "ui/views/controls/menu/menu.h" | |
12 | |
13 namespace views { | |
14 | |
15 class MenuGtk : public Menu { | |
16 public: | |
17 // Construct a Menu using the specified controller to determine command | |
18 // state. | |
19 // delegate A Menu::Delegate implementation that provides more | |
20 // information about the Menu presentation. | |
21 // anchor An alignment hint for the popup menu. | |
22 // owner The window that the menu is being brought up relative | |
23 // to. Not actually used for anything but must not be | |
24 // NULL. | |
25 MenuGtk(Delegate* d, AnchorPoint anchor, gfx::NativeView owner); | |
26 virtual ~MenuGtk(); | |
27 | |
28 // Overridden from Menu: | |
29 virtual Menu* AddSubMenuWithIcon(int index, | |
30 int item_id, | |
31 const string16& label, | |
32 const SkBitmap& icon) OVERRIDE; | |
33 virtual void AddSeparator(int index) OVERRIDE; | |
34 virtual void EnableMenuItemByID(int item_id, bool enabled) OVERRIDE; | |
35 virtual void EnableMenuItemAt(int index, bool enabled) OVERRIDE; | |
36 virtual void SetMenuLabel(int item_id, const string16& label) OVERRIDE; | |
37 virtual bool SetIcon(const SkBitmap& icon, int item_id) OVERRIDE; | |
38 virtual void RunMenuAt(int x, int y) OVERRIDE; | |
39 virtual void Cancel() OVERRIDE; | |
40 virtual int ItemCount() OVERRIDE; | |
41 | |
42 protected: | |
43 virtual void AddMenuItemInternal(int index, | |
44 int item_id, | |
45 const string16& label, | |
46 const SkBitmap& icon, | |
47 MenuItemType type) OVERRIDE; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(MenuGtk); | |
50 }; | |
51 | |
52 } // namespace views | |
53 | |
54 #endif // UI_VIEWS_CONTROLS_MENU_MENU_GTK_H_ | |
OLD | NEW |