OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ui/app_list/app_list_menu.h" | |
6 | |
7 #include "grit/ui_strings.h" | |
8 #include "ui/app_list/app_list_view_delegate.h" | |
9 #include "ui/base/l10n/l10n_util.h" | |
10 #include "ui/base/models/menu_separator_types.h" | |
11 #include "ui/base/resource/resource_bundle.h" | |
12 | |
13 namespace app_list { | |
14 | |
15 AppListMenu::AppListMenu(AppListViewDelegate* delegate) | |
16 : ALLOW_THIS_IN_INITIALIZER_LIST(menu_model_(this)), | |
17 delegate_(delegate) { | |
18 InitMenu(); | |
19 } | |
20 | |
21 void AppListMenu::InitMenu() { | |
22 menu_model_.AddItem(CURRENT_USER, L""); | |
tapted
2013/03/20 07:44:20
L"" -> string16()
benwells
2013/03/20 08:43:34
Done.
| |
23 menu_model_.AddSeparator(ui::NORMAL_SEPARATOR); | |
24 | |
25 menu_model_.AddItem(SHOW_SETTINGS, l10n_util::GetStringUTF16( | |
26 IDS_APP_LIST_OPEN_SETTINGS)); | |
27 | |
28 menu_model_.AddItem(SHOW_FEEDBACK, l10n_util::GetStringUTF16( | |
29 IDS_APP_LIST_OPEN_FEEDBACK)); | |
30 } | |
31 | |
32 bool AppListMenu::IsCommandIdChecked(int command_id) const { | |
33 return false; | |
34 } | |
35 | |
36 bool AppListMenu::IsCommandIdEnabled(int command_id) const { | |
37 return true; | |
38 } | |
39 | |
40 bool AppListMenu::GetAcceleratorForCommandId( | |
41 int command_id, | |
tapted
2013/03/20 07:44:20
nit: indenting is off
benwells
2013/03/20 08:43:34
Done.
| |
42 ui::Accelerator* accelerator) { | |
43 return false; | |
44 } | |
45 | |
46 void AppListMenu::ExecuteCommand(int command_id, int event_flags) { | |
47 switch (command_id) { | |
48 case CURRENT_USER: | |
49 break; // Do nothing | |
tapted
2013/03/20 07:44:20
nit: full-stop at end of comment.
benwells
2013/03/20 08:43:34
Done.
| |
50 case SHOW_SETTINGS: | |
51 delegate_->OpenSettings(); | |
52 break; | |
53 case SHOW_FEEDBACK: | |
54 delegate_->OpenFeedback(); | |
55 break; | |
56 default: | |
57 NOTREACHED(); | |
58 } | |
59 } | |
60 | |
61 } // namespace app_list | |
OLD | NEW |