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

Unified Diff: ui/base/models/button_menu_item_model.h

Issue 2138353002: SimpleMenuModel and ButtonMenuItemModel implement AcceleratorProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@menumodel-accelerator-default
Patch Set: Fix compile on Windows. Created 4 years, 5 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 | « chrome/test/base/menu_model_test.cc ('k') | ui/base/models/simple_menu_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/models/button_menu_item_model.h
diff --git a/ui/base/models/button_menu_item_model.h b/ui/base/models/button_menu_item_model.h
index 98a72344d7eb9081283ea709e863e2a49d67e071..0b15d9c26aee49346b716b8dcecdf50723c772ea 100644
--- a/ui/base/models/button_menu_item_model.h
+++ b/ui/base/models/button_menu_item_model.h
@@ -7,14 +7,14 @@
#include <vector>
+#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/strings/string16.h"
+#include "ui/base/accelerators/accelerator.h"
#include "ui/base/ui_base_export.h"
namespace ui {
-class Accelerator;
-
// A model representing the rows of buttons that should be inserted in a button
// containing menu item.
class UI_BASE_EXPORT ButtonMenuItemModel {
@@ -26,7 +26,8 @@ class UI_BASE_EXPORT ButtonMenuItemModel {
TYPE_BUTTON_LABEL
};
- class UI_BASE_EXPORT Delegate {
+ class UI_BASE_EXPORT Delegate
+ : NON_EXPORTED_BASE(public AcceleratorProvider) {
public:
// Some command ids have labels that change over time.
virtual bool IsItemForCommandIdDynamic(int command_id) const;
@@ -37,14 +38,14 @@ class UI_BASE_EXPORT ButtonMenuItemModel {
virtual bool IsCommandIdEnabled(int command_id) const;
virtual bool DoesCommandIdDismissMenu(int command_id) const;
- // Gets the accelerator for the specified command id. Returns true if the
- // command id has a valid accelerator, false otherwise. By default, returns
- // false for all commands.
- virtual bool GetAcceleratorForCommandId(int command_id,
- ui::Accelerator* accelerator) const;
+ // AcceleratorProvider overrides:
+ // By default, returns false for all commands. Can be further overridden.
+ bool GetAcceleratorForCommandId(
+ int command_id,
+ ui::Accelerator* accelerator) const override;
protected:
- virtual ~Delegate() {}
+ ~Delegate() override {}
};
ButtonMenuItemModel(int string_id, ButtonMenuItemModel::Delegate* delegate);
« no previous file with comments | « chrome/test/base/menu_model_test.cc ('k') | ui/base/models/simple_menu_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698