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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/profile_menu_model.h" 5 #include "chrome/browser/ui/profile_menu_model.h"
6 6
7 #include "chrome/browser/profiles/profile_manager.h"
7 #include "grit/generated_resources.h" 8 #include "grit/generated_resources.h"
8 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
9 10
10 ProfileMenuModel::ProfileMenuModel(ui::SimpleMenuModel::Delegate* delegate) 11 ProfileMenuModel::ProfileMenuModel()
11 : ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(delegate)) { 12 : ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(this)) {
12 AddItem(COMMAND_CREATE_NEW_PROFILE, l10n_util::GetStringUTF16( 13 AddItem(COMMAND_CREATE_NEW_PROFILE, l10n_util::GetStringUTF16(
13 IDS_PROFILES_CREATE_NEW_PROFILE_OPTION)); 14 IDS_PROFILES_CREATE_NEW_PROFILE_OPTION));
14 } 15 }
15 16
16 ProfileMenuModel::~ProfileMenuModel() { 17 ProfileMenuModel::~ProfileMenuModel() {
17 } 18 }
19
20 // ui::SimpleMenuModel::Delegate implementation
21 bool ProfileMenuModel::IsCommandIdChecked(int command_id) const {
22 return false;
23 }
24
25 bool ProfileMenuModel::IsCommandIdEnabled(int command_id) const {
26 return true;
27 }
28
29 bool ProfileMenuModel::GetAcceleratorForCommandId(int command_id,
30 ui::Accelerator* accelerator) {
31 return false;
32 }
33
34 void ProfileMenuModel::ExecuteCommand(int command_id) {
35 switch (command_id) {
36 case COMMAND_CREATE_NEW_PROFILE:
37 ProfileManager::CreateMultiProfileAsync();
38 break;
39 default:
40 NOTREACHED();
41 break;
42 }
43 }
44
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698