OLD | NEW |
1 // Copyright (c) 2011 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 VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_ | 5 #ifndef VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_ |
6 #define VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_ | 6 #define VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 } | 39 } |
40 int triggerable_event_flags() const { return triggerable_event_flags_; } | 40 int triggerable_event_flags() const { return triggerable_event_flags_; } |
41 | 41 |
42 protected: | 42 protected: |
43 // views::MenuDelegate implementation. | 43 // views::MenuDelegate implementation. |
44 virtual void ExecuteCommand(int id) OVERRIDE; | 44 virtual void ExecuteCommand(int id) OVERRIDE; |
45 virtual void ExecuteCommand(int id, int mouse_event_flags) OVERRIDE; | 45 virtual void ExecuteCommand(int id, int mouse_event_flags) OVERRIDE; |
46 virtual bool IsTriggerableEvent(MenuItemView* source, | 46 virtual bool IsTriggerableEvent(MenuItemView* source, |
47 const MouseEvent& e) OVERRIDE; | 47 const MouseEvent& e) OVERRIDE; |
48 virtual bool GetAccelerator(int id, | 48 virtual bool GetAccelerator(int id, |
49 views::Accelerator* accelerator) OVERRIDE; | 49 ui::Accelerator* accelerator) OVERRIDE; |
50 virtual string16 GetLabel(int id) const OVERRIDE; | 50 virtual string16 GetLabel(int id) const OVERRIDE; |
51 virtual const gfx::Font& GetLabelFont(int id) const OVERRIDE; | 51 virtual const gfx::Font& GetLabelFont(int id) const OVERRIDE; |
52 virtual bool IsCommandEnabled(int id) const OVERRIDE; | 52 virtual bool IsCommandEnabled(int id) const OVERRIDE; |
53 virtual bool IsItemChecked(int id) const OVERRIDE; | 53 virtual bool IsItemChecked(int id) const OVERRIDE; |
54 virtual void SelectionChanged(MenuItemView* menu) OVERRIDE; | 54 virtual void SelectionChanged(MenuItemView* menu) OVERRIDE; |
55 virtual void WillShowMenu(MenuItemView* menu) OVERRIDE; | 55 virtual void WillShowMenu(MenuItemView* menu) OVERRIDE; |
56 virtual void WillHideMenu(MenuItemView* menu) OVERRIDE; | 56 virtual void WillHideMenu(MenuItemView* menu) OVERRIDE; |
57 | 57 |
58 private: | 58 private: |
59 // Implementation of BuildMenu(). index_offset is both input and output; | 59 // Implementation of BuildMenu(). index_offset is both input and output; |
(...skipping 11 matching lines...) Expand all Loading... |
71 | 71 |
72 // Map MenuItems to MenuModels. Used to implement WillShowMenu(). | 72 // Map MenuItems to MenuModels. Used to implement WillShowMenu(). |
73 std::map<MenuItemView*, ui::MenuModel*> menu_map_; | 73 std::map<MenuItemView*, ui::MenuModel*> menu_map_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(MenuModelAdapter); | 75 DISALLOW_COPY_AND_ASSIGN(MenuModelAdapter); |
76 }; | 76 }; |
77 | 77 |
78 } // namespace views | 78 } // namespace views |
79 | 79 |
80 #endif // VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_ | 80 #endif // VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_ |
OLD | NEW |