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

Side by Side Diff: chrome/browser/ui/app_list/arc/arc_playstore_app_context_menu.cc

Issue 2929273002: Add the Play Store app search to the launcher. (Closed)
Patch Set: Fix unittest build failure. Created 3 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 unified diff | Download patch
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698