OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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_NATIVE_MENU_WIN_H_ | 5 #ifndef VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ |
6 #define VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ | 6 #define VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 // Overridden from MenuWrapper: | 27 // Overridden from MenuWrapper: |
28 virtual void RunMenuAt(const gfx::Point& point, int alignment); | 28 virtual void RunMenuAt(const gfx::Point& point, int alignment); |
29 virtual void CancelMenu(); | 29 virtual void CancelMenu(); |
30 virtual void Rebuild(); | 30 virtual void Rebuild(); |
31 virtual void UpdateStates(); | 31 virtual void UpdateStates(); |
32 virtual gfx::NativeMenu GetNativeMenu() const; | 32 virtual gfx::NativeMenu GetNativeMenu() const; |
33 virtual MenuAction GetMenuAction() const; | 33 virtual MenuAction GetMenuAction() const; |
34 virtual void AddMenuListener(MenuListener* listener); | 34 virtual void AddMenuListener(MenuListener* listener); |
35 virtual void RemoveMenuListener(MenuListener* listener); | 35 virtual void RemoveMenuListener(MenuListener* listener); |
| 36 virtual void SetMinimumWidth(int width); |
36 | 37 |
37 private: | 38 private: |
38 // IMPORTANT: Note about indices. | 39 // IMPORTANT: Note about indices. |
39 // Functions in this class deal in two index spaces: | 40 // Functions in this class deal in two index spaces: |
40 // 1. menu_index - the index of an item within the actual Windows | 41 // 1. menu_index - the index of an item within the actual Windows |
41 // native menu. | 42 // native menu. |
42 // 2. model_index - the index of the item within our model. | 43 // 2. model_index - the index of the item within our model. |
43 // These two are most often but not always the same value! The | 44 // These two are most often but not always the same value! The |
44 // notable exception is when this object is used to wrap the | 45 // notable exception is when this object is used to wrap the |
45 // Windows System Menu. In this instance, the model indices start | 46 // Windows System Menu. In this instance, the model indices start |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // Overridden from SimpleMenuModel: | 157 // Overridden from SimpleMenuModel: |
157 virtual int FlipIndex(int index) const { return GetItemCount() - index - 1; } | 158 virtual int FlipIndex(int index) const { return GetItemCount() - index - 1; } |
158 | 159 |
159 private: | 160 private: |
160 DISALLOW_COPY_AND_ASSIGN(SystemMenuModel); | 161 DISALLOW_COPY_AND_ASSIGN(SystemMenuModel); |
161 }; | 162 }; |
162 | 163 |
163 } // namespace views | 164 } // namespace views |
164 | 165 |
165 #endif // VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ | 166 #endif // VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ |
OLD | NEW |