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

Unified Diff: chrome/browser/ui/profile_menu_model.cc

Issue 7054031: Mac: Use cross-platform menu model for profile button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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
Index: chrome/browser/ui/profile_menu_model.cc
diff --git a/chrome/browser/ui/profile_menu_model.cc b/chrome/browser/ui/profile_menu_model.cc
index 7614aed2911630370fdac2219bd40173555bd93d..46ab4bcfa7b2ec357865d8bd87b8d7472152b7e7 100644
--- a/chrome/browser/ui/profile_menu_model.cc
+++ b/chrome/browser/ui/profile_menu_model.cc
@@ -4,14 +4,41 @@
#include "chrome/browser/ui/profile_menu_model.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
-ProfileMenuModel::ProfileMenuModel(ui::SimpleMenuModel::Delegate* delegate)
- : ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(delegate)) {
+ProfileMenuModel::ProfileMenuModel()
+ : ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(this)) {
AddItem(COMMAND_CREATE_NEW_PROFILE, l10n_util::GetStringUTF16(
IDS_PROFILES_CREATE_NEW_PROFILE_OPTION));
}
ProfileMenuModel::~ProfileMenuModel() {
}
+
+// ui::SimpleMenuModel::Delegate implementation
+bool ProfileMenuModel::IsCommandIdChecked(int command_id) const {
+ return false;
+}
+
+bool ProfileMenuModel::IsCommandIdEnabled(int command_id) const {
+ return true;
+}
+
+bool ProfileMenuModel::GetAcceleratorForCommandId(int command_id,
+ ui::Accelerator* accelerator) {
+ return false;
+}
+
+void ProfileMenuModel::ExecuteCommand(int command_id) {
+ switch (command_id) {
+ case COMMAND_CREATE_NEW_PROFILE:
+ ProfileManager::CreateMultiProfileAsync();
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
+}
+

Powered by Google App Engine
This is Rietveld 408576698