| 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_;
|
|
|