| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ |
| 6 #define UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // TODO(beng): rename to MenuWin once the old class is dead. | 26 // TODO(beng): rename to MenuWin once the old class is dead. |
| 27 class VIEWS_EXPORT NativeMenuWin : public MenuWrapper { | 27 class VIEWS_EXPORT NativeMenuWin : public MenuWrapper { |
| 28 public: | 28 public: |
| 29 // Construct a NativeMenuWin, with a model and delegate. If |system_menu_for| | 29 // Construct a NativeMenuWin, with a model and delegate. If |system_menu_for| |
| 30 // is non-NULL, the NativeMenuWin wraps the system menu for that window. | 30 // is non-NULL, the NativeMenuWin wraps the system menu for that window. |
| 31 // The caller owns the model and the delegate. | 31 // The caller owns the model and the delegate. |
| 32 NativeMenuWin(ui::MenuModel* model, HWND system_menu_for); | 32 NativeMenuWin(ui::MenuModel* model, HWND system_menu_for); |
| 33 virtual ~NativeMenuWin(); | 33 virtual ~NativeMenuWin(); |
| 34 | 34 |
| 35 // Overridden from MenuWrapper: | 35 // Overridden from MenuWrapper: |
| 36 virtual void RunMenuAt(const gfx::Point& point, int alignment) OVERRIDE; | 36 virtual void RunMenuAt(const gfx::Point& point, int alignment) override; |
| 37 virtual void CancelMenu() OVERRIDE; | 37 virtual void CancelMenu() override; |
| 38 virtual void Rebuild(MenuInsertionDelegateWin* delegate) OVERRIDE; | 38 virtual void Rebuild(MenuInsertionDelegateWin* delegate) override; |
| 39 virtual void UpdateStates() OVERRIDE; | 39 virtual void UpdateStates() override; |
| 40 virtual HMENU GetNativeMenu() const OVERRIDE; | 40 virtual HMENU GetNativeMenu() const override; |
| 41 virtual MenuAction GetMenuAction() const OVERRIDE; | 41 virtual MenuAction GetMenuAction() const override; |
| 42 virtual void AddMenuListener(MenuListener* listener) OVERRIDE; | 42 virtual void AddMenuListener(MenuListener* listener) override; |
| 43 virtual void RemoveMenuListener(MenuListener* listener) OVERRIDE; | 43 virtual void RemoveMenuListener(MenuListener* listener) override; |
| 44 virtual void SetMinimumWidth(int width) OVERRIDE; | 44 virtual void SetMinimumWidth(int width) override; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 // IMPORTANT: Note about indices. | 47 // IMPORTANT: Note about indices. |
| 48 // Functions in this class deal in two index spaces: | 48 // Functions in this class deal in two index spaces: |
| 49 // 1. menu_index - the index of an item within the actual Windows | 49 // 1. menu_index - the index of an item within the actual Windows |
| 50 // native menu. | 50 // native menu. |
| 51 // 2. model_index - the index of the item within our model. | 51 // 2. model_index - the index of the item within our model. |
| 52 // These two are most often but not always the same value! The | 52 // These two are most often but not always the same value! The |
| 53 // notable exception is when this object is used to wrap the | 53 // notable exception is when this object is used to wrap the |
| 54 // Windows System Menu. In this instance, the model indices start | 54 // Windows System Menu. In this instance, the model indices start |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // has a menu open, because our hook function that receives keyboard | 160 // has a menu open, because our hook function that receives keyboard |
| 161 // events doesn't have a mechanism to get a user data pointer. | 161 // events doesn't have a mechanism to get a user data pointer. |
| 162 static NativeMenuWin* open_native_menu_win_; | 162 static NativeMenuWin* open_native_menu_win_; |
| 163 | 163 |
| 164 DISALLOW_COPY_AND_ASSIGN(NativeMenuWin); | 164 DISALLOW_COPY_AND_ASSIGN(NativeMenuWin); |
| 165 }; | 165 }; |
| 166 | 166 |
| 167 } // namespace views | 167 } // namespace views |
| 168 | 168 |
| 169 #endif // UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ | 169 #endif // UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ |
| OLD | NEW |