Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Unified Diff: trunk/src/ui/views/controls/menu/native_menu_win.h

Issue 14320040: Revert 194356 "views: Finally get rid of the deprecated Menu2 API." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/ui/views/controls/menu/native_menu_win.h
===================================================================
--- trunk/src/ui/views/controls/menu/native_menu_win.h (revision 195258)
+++ trunk/src/ui/views/controls/menu/native_menu_win.h (working copy)
@@ -8,57 +8,40 @@
#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 {
-class MenuInsertionDelegate;
-class MenuListener;
-
-class VIEWS_EXPORT NativeMenuWin {
+// A Windows implementation of MenuWrapper.
+// TODO(beng): rename to MenuWin once the old class is dead.
+class VIEWS_EXPORT NativeMenuWin : public MenuWrapper {
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);
- ~NativeMenuWin();
+ virtual ~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);
+ // 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;
private:
// IMPORTANT: Note about indices.
« no previous file with comments | « trunk/src/ui/views/controls/menu/menu_wrapper.h ('k') | trunk/src/ui/views/controls/menu/native_menu_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698