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

Unified 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: Finished comments and merged with the context menu CL. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/playstore_app_context_menu.cc
diff --git a/chrome/browser/ui/app_list/playstore_app_context_menu.cc b/chrome/browser/ui/app_list/playstore_app_context_menu.cc
new file mode 100644
index 0000000000000000000000000000000000000000..83ce44a6d7e4408025e73a100aa10ee53d4bb61b
--- /dev/null
+++ b/chrome/browser/ui/app_list/playstore_app_context_menu.cc
@@ -0,0 +1,41 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/app_list/playstore_app_context_menu.h"
+
+#include "chrome/browser/ui/app_list/app_context_menu_delegate.h"
+#include "chrome/grit/generated_resources.h"
+
+PlayStoreAppContextMenu::PlayStoreAppContextMenu(
+ app_list::AppContextMenuDelegate* delegate,
+ Profile* profile,
+ AppListControllerDelegate* controller)
+ : app_list::AppContextMenu(delegate, profile, std::string(), controller) {}
+
+PlayStoreAppContextMenu::~PlayStoreAppContextMenu() {}
Luis Héctor Chávez 2017/06/22 15:42:09 nit: = default;
Jiaquan He 2017/06/22 19:12:40 Done.
+
+void PlayStoreAppContextMenu::BuildMenu(ui::SimpleMenuModel* menu_model) {
+ // App Info item.
+ menu_model->AddItemWithStringId(INSTALL, IDS_APP_CONTEXT_MENU_INSTALL);
+}
+
+bool PlayStoreAppContextMenu::IsCommandIdEnabled(int command_id) const {
+ switch (command_id) {
+ case INSTALL:
+ return true;
+ default:
+ return app_list::AppContextMenu::IsCommandIdEnabled(command_id);
+ }
+ return false;
Luis Héctor Chávez 2017/06/22 15:42:09 unneeded
Jiaquan He 2017/06/22 19:12:40 Done.
+}
+
+void PlayStoreAppContextMenu::ExecuteCommand(int command_id, int event_flags) {
+ switch (command_id) {
+ case INSTALL:
+ delegate()->ExecuteLaunchCommand(event_flags);
+ break;
+ default:
+ app_list::AppContextMenu::ExecuteCommand(command_id, event_flags);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698