OLD | NEW |
| (Empty) |
1 // Copyright 2017 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 "chrome/browser/ui/app_list/arc/arc_playstore_app_context_menu.h" | |
6 | |
7 #include <string> | |
8 | |
9 #include "chrome/browser/ui/app_list/app_context_menu_delegate.h" | |
10 #include "chrome/grit/generated_resources.h" | |
11 | |
12 ArcPlayStoreAppContextMenu::ArcPlayStoreAppContextMenu( | |
13 app_list::AppContextMenuDelegate* delegate, | |
14 Profile* profile, | |
15 AppListControllerDelegate* controller) | |
16 : app_list::AppContextMenu(delegate, profile, std::string(), controller) {} | |
17 | |
18 ArcPlayStoreAppContextMenu::~ArcPlayStoreAppContextMenu() = default; | |
19 | |
20 void ArcPlayStoreAppContextMenu::BuildMenu(ui::SimpleMenuModel* menu_model) { | |
21 // App Info item. | |
22 menu_model->AddItemWithStringId(INSTALL, IDS_APP_CONTEXT_MENU_INSTALL_ARC); | |
23 } | |
24 | |
25 bool ArcPlayStoreAppContextMenu::IsCommandIdEnabled(int command_id) const { | |
26 switch (command_id) { | |
27 case INSTALL: | |
28 return true; | |
29 default: | |
30 return app_list::AppContextMenu::IsCommandIdEnabled(command_id); | |
31 } | |
32 } | |
33 | |
34 void ArcPlayStoreAppContextMenu::ExecuteCommand(int command_id, | |
35 int event_flags) { | |
36 switch (command_id) { | |
37 case INSTALL: | |
38 delegate()->ExecuteLaunchCommand(event_flags); | |
39 break; | |
40 default: | |
41 app_list::AppContextMenu::ExecuteCommand(command_id, event_flags); | |
42 } | |
43 } | |
OLD | NEW |