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

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

Issue 14150005: views: Finally get rid of the deprecated Menu2 API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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
« no previous file with comments | « ui/views/controls/menu/menu_wrapper.h ('k') | ui/views/controls/menu/native_menu_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « ui/views/controls/menu/menu_wrapper.h ('k') | ui/views/controls/menu/native_menu_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698