Chromium Code Reviews| Index: ui/views/controls/menu/native_menu_win.h |
| diff --git a/ui/views/controls/menu/native_menu_win.h b/ui/views/controls/menu/native_menu_win.h |
| index 5b2065c7ac06a5839685cd492b341922ff1af688..a892e82ce92dfbfcee39300053d18d4ef3b9caf0 100644 |
| --- a/ui/views/controls/menu/native_menu_win.h |
| +++ b/ui/views/controls/menu/native_menu_win.h |
| @@ -8,40 +8,58 @@ |
| #include <vector> |
| #include "base/basictypes.h" |
| -#include "base/compiler_specific.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/observer_list.h" |
| #include "base/string16.h" |
| -#include "ui/views/controls/menu/menu_wrapper.h" |
| #include "ui/views/views_export.h" |
| +namespace gfx { |
| +class Point; |
| +} |
| + |
| namespace ui { |
| class MenuModel; |
| } |
| namespace views { |
| -// A Windows implementation of MenuWrapper. |
| +class MenuInsertionDelegate; |
| +class MenuListener; |
| + |
| // TODO(beng): rename to MenuWin once the old class is dead. |
|
sky
2013/04/15 21:00:33
Nuke comment.
tfarina
2013/04/15 22:23:11
Done.
|
| -class VIEWS_EXPORT NativeMenuWin : public MenuWrapper { |
| +class VIEWS_EXPORT NativeMenuWin { |
| public: |
| + // All of the possible actions that can result from RunMenuAt. |
| + enum MenuAction { |
| + MENU_ACTION_NONE, // Menu cancelled, or never opened. |
| + MENU_ACTION_SELECTED, // An item was selected. |
| + MENU_ACTION_PREVIOUS, // User wants to navigate to the previous menu. |
| + MENU_ACTION_NEXT, // User wants to navigate to the next menu. |
| + }; |
| + |
| + // How the menu is aligned relative to the point it is shown at. |
| + // The alignment is reversed by menu if text direction is right to left. |
| + enum Alignment { |
| + ALIGN_TOPLEFT, |
| + ALIGN_TOPRIGHT |
| + }; |
| + |
| // Construct a NativeMenuWin, with a model and delegate. If |system_menu_for| |
| // is non-NULL, the NativeMenuWin wraps the system menu for that window. |
| // The caller owns the model and the delegate. |
| NativeMenuWin(ui::MenuModel* model, HWND system_menu_for); |
| - virtual ~NativeMenuWin(); |
| - |
| - // Overridden from MenuWrapper: |
| - virtual void RunMenuAt(const gfx::Point& point, int alignment) OVERRIDE; |
| - virtual void CancelMenu() OVERRIDE; |
| - virtual void Rebuild(InsertionDelegate* delegate) OVERRIDE; |
| - virtual void UpdateStates() OVERRIDE; |
| - virtual HMENU GetNativeMenu() const OVERRIDE; |
| - virtual MenuAction GetMenuAction() const OVERRIDE; |
| - virtual void AddMenuListener(MenuListener* listener) OVERRIDE; |
| - virtual void RemoveMenuListener(MenuListener* listener) OVERRIDE; |
| - virtual void SetMinimumWidth(int width) OVERRIDE; |
| + ~NativeMenuWin(); |
| + |
| + void RunMenuAt(const gfx::Point& point, int alignment); |
| + void CancelMenu(); |
| + void Rebuild(MenuInsertionDelegate* delegate); |
| + void UpdateStates(); |
| + HMENU GetNativeMenu() const; |
| + MenuAction GetMenuAction() const; |
| + void AddMenuListener(MenuListener* listener); |
| + void RemoveMenuListener(MenuListener* listener); |
| + void SetMinimumWidth(int width); |
| private: |
| // IMPORTANT: Note about indices. |