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

Side by Side Diff: chrome/browser/ui/app_list/playstore_app_context_menu.cc

Issue 2929273002: Add the Play Store app search to the launcher. (Closed)
Patch Set: Implement methods in FakeAppInstance. Created 3 years, 6 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/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 PlayStoreAppContextMenu::PlayStoreAppContextMenu(
13 app_list::AppContextMenuDelegate* delegate,
14 Profile* profile,
15 AppListControllerDelegate* controller)
16 : app_list::AppContextMenu(delegate, profile, std::string(), controller) {}
17
18 PlayStoreAppContextMenu::~PlayStoreAppContextMenu() = default;
19
20 void PlayStoreAppContextMenu::BuildMenu(ui::SimpleMenuModel* menu_model) {
21 // App Info item.
22 menu_model->AddItemWithStringId(INSTALL, IDS_APP_CONTEXT_MENU_INSTALL);
23 }
24
25 bool PlayStoreAppContextMenu::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 PlayStoreAppContextMenu::ExecuteCommand(int command_id, int event_flags) {
35 switch (command_id) {
36 case INSTALL:
37 delegate()->ExecuteLaunchCommand(event_flags);
38 break;
39 default:
40 app_list::AppContextMenu::ExecuteCommand(command_id, event_flags);
41 }
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698