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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_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 | « no previous file | chrome/browser/autocomplete/autocomplete_edit_view_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_edit_view_win.h
===================================================================
--- chrome/browser/autocomplete/autocomplete_edit_view_win.h (revision 18306)
+++ chrome/browser/autocomplete/autocomplete_edit_view_win.h (working copy)
@@ -19,7 +19,7 @@
#include "chrome/browser/toolbar_model.h"
#include "chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h"
#include "chrome/common/page_transition_types.h"
-#include "views/controls/menu/menu.h"
+#include "views/controls/menu/simple_menu_model.h"
#include "webkit/glue/window_open_disposition.h"
class AutocompletePopupModel;
@@ -44,7 +44,7 @@
CWinTraits<WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL |
ES_NOHIDESEL> >,
public CRichEditCommands<AutocompleteEditViewWin>,
- public views::Menu::Delegate,
+ public views::SimpleMenuModel::Delegate,
public AutocompleteEditView {
public:
struct State {
@@ -179,10 +179,14 @@
DEFAULT_REFLECTION_HANDLER() // avoids black margin area
END_MSG_MAP()
- // Menu::Delegate
- virtual bool IsCommandEnabled(int id) const;
- virtual bool GetContextualLabel(int id, std::wstring* out) const;
- virtual void ExecuteCommand(int id);
+ // SimpleMenuModel::Delegate
+ virtual bool IsCommandIdChecked(int command_id) const;
+ virtual bool IsCommandIdEnabled(int command_id) const;
+ virtual bool GetAcceleratorForCommandId(int command_id,
+ views::Accelerator* accelerator);
+ virtual bool IsLabelForCommandIdDynamic(int command_id) const;
+ virtual std::wstring GetLabelForCommandId(int command_id) const;
+ virtual void ExecuteCommand(int command_id);
private:
// This object freezes repainting of the edit until the object is destroyed.
@@ -357,6 +361,9 @@
// text.
void RepaintDropHighlight(int position);
+ // Generates the context menu for the edit field.
+ void BuildContextMenu();
+
scoped_ptr<AutocompleteEditModel> model_;
scoped_ptr<AutocompletePopupView> popup_view_;
@@ -426,7 +433,8 @@
CHARRANGE saved_selection_for_focus_change_;
// The context menu for the edit.
- scoped_ptr<views::Menu> context_menu_;
+ scoped_ptr<views::SimpleMenuModel> context_menu_contents_;
+ scoped_ptr<views::Menu2> context_menu_;
// Font we're using. We keep a reference to make sure the font supplied to
// the constructor doesn't go away before we do.
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_edit_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698