Index: chrome/browser/ui/app_list/arc/arc_playstore_app_context_menu.cc |
diff --git a/chrome/browser/ui/app_list/arc/arc_playstore_app_context_menu.cc b/chrome/browser/ui/app_list/arc/arc_playstore_app_context_menu.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4a92b361ce9daa7633c6cb894bf5dcb1a058743c |
--- /dev/null |
+++ b/chrome/browser/ui/app_list/arc/arc_playstore_app_context_menu.cc |
@@ -0,0 +1,43 @@ |
+// 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/arc/arc_playstore_app_context_menu.h" |
+ |
+#include <string> |
+ |
+#include "chrome/browser/ui/app_list/app_context_menu_delegate.h" |
+#include "chrome/grit/generated_resources.h" |
+ |
+ArcPlayStoreAppContextMenu::ArcPlayStoreAppContextMenu( |
+ app_list::AppContextMenuDelegate* delegate, |
+ Profile* profile, |
+ AppListControllerDelegate* controller) |
+ : app_list::AppContextMenu(delegate, profile, std::string(), controller) {} |
+ |
+ArcPlayStoreAppContextMenu::~ArcPlayStoreAppContextMenu() = default; |
+ |
+void ArcPlayStoreAppContextMenu::BuildMenu(ui::SimpleMenuModel* menu_model) { |
+ // App Info item. |
+ menu_model->AddItemWithStringId(INSTALL, IDS_APP_CONTEXT_MENU_INSTALL_ARC); |
+} |
+ |
+bool ArcPlayStoreAppContextMenu::IsCommandIdEnabled(int command_id) const { |
+ switch (command_id) { |
+ case INSTALL: |
+ return true; |
+ default: |
+ return app_list::AppContextMenu::IsCommandIdEnabled(command_id); |
+ } |
+} |
+ |
+void ArcPlayStoreAppContextMenu::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); |
+ } |
+} |