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

Unified Diff: views/controls/textfield/native_textfield_win.h

Issue 122027: Remove the Menu object, converting all the remaining callers to use Menu2. I'... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 | « views/controls/menu/native_menu_win.cc ('k') | views/controls/textfield/native_textfield_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/textfield/native_textfield_win.h
===================================================================
--- views/controls/textfield/native_textfield_win.h (revision 18306)
+++ views/controls/textfield/native_textfield_win.h (working copy)
@@ -13,6 +13,7 @@
#include <tom.h> // For ITextDocument, a COM interface to CRichEditCtrl
#include <vsstyle.h>
+#include "views/controls/menu/simple_menu_model.h"
#include "views/controls/textfield/native_textfield_wrapper.h"
namespace views {
@@ -28,7 +29,7 @@
CWinTraits<kDefaultEditStyle> >,
public CRichEditCommands<NativeTextfieldWin>,
public NativeTextfieldWrapper,
- public Menu::Delegate {
+ public SimpleMenuModel::Delegate {
public:
DECLARE_WND_CLASS(L"ViewsTextfieldEdit");
@@ -52,6 +53,13 @@
virtual View* GetView();
virtual gfx::NativeView GetTestingHandle() const;
+ // Overridden from SimpleMenuModel::Delegate:
+ virtual bool IsCommandIdChecked(int command_id) const;
+ virtual bool IsCommandIdEnabled(int command_id) const;
+ virtual bool GetAcceleratorForCommandId(int command_id,
+ Accelerator* accelerator);
+ virtual void ExecuteCommand(int command_id);
+
// CWindowImpl
BEGIN_MSG_MAP(Edit)
MSG_WM_CHAR(OnChar)
@@ -79,10 +87,6 @@
MSG_WM_SYSKEYDOWN(OnKeyDown)
END_MSG_MAP()
- // Menu::Delegate
- virtual bool IsCommandEnabled(int id) const;
- virtual void ExecuteCommand(int id);
-
private:
// This object freezes repainting of the edit until the object is destroyed.
// Some methods of the CRichEditCtrl draw synchronously to the screen. If we
@@ -156,6 +160,9 @@
// alive.
ITextDocument* GetTextObjectModel() const;
+ // Generates the contents of the context menu.
+ void BuildContextMenu();
+
// The Textfield this object is bound to.
Textfield* textfield_;
@@ -177,8 +184,9 @@
static bool did_load_library_;
- // The context menu for the edit.
- scoped_ptr<Menu> context_menu_;
+ // The contents of the context menu for the edit.
+ scoped_ptr<SimpleMenuModel> context_menu_contents_;
+ scoped_ptr<Menu2> context_menu_;
// Border insets.
gfx::Insets content_insets_;
« no previous file with comments | « views/controls/menu/native_menu_win.cc ('k') | views/controls/textfield/native_textfield_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698