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

Unified Diff: chrome/browser/ui/ash/launcher/arc_launcher_context_menu.cc

Issue 1869063002: Arc integration in shelf launcher context menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include file only when necessary Created 4 years, 8 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/ash/launcher/arc_launcher_context_menu.cc
diff --git a/chrome/browser/ui/ash/launcher/arc_launcher_context_menu.cc b/chrome/browser/ui/ash/launcher/arc_launcher_context_menu.cc
new file mode 100644
index 0000000000000000000000000000000000000000..db4629799a39b63f12e9e94b2dd3e1a646f0a942
--- /dev/null
+++ b/chrome/browser/ui/ash/launcher/arc_launcher_context_menu.cc
@@ -0,0 +1,35 @@
+// Copyright 2016 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/ash/launcher/arc_launcher_context_menu.h"
+
+#include "ash/shelf/shelf_item_types.h"
+#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
+#include "chrome/grit/generated_resources.h"
+
+ArcLauncherContextMenu::ArcLauncherContextMenu(
+ ChromeLauncherController* controller,
+ const ash::ShelfItem* item,
+ ash::Shelf* shelf)
+ : LauncherContextMenu(controller, item, shelf) {
+ Init();
+}
+
+ArcLauncherContextMenu::~ArcLauncherContextMenu() {}
+
+void ArcLauncherContextMenu::Init() {
+ AddItemWithStringId(MENU_OPEN_NEW, IDS_APP_CONTEXT_MENU_ACTIVATE_ARC);
+ AddSeparator(ui::NORMAL_SEPARATOR);
+ AddPinMenu();
+ if (controller()->IsOpen(item().id))
+ AddItemWithStringId(MENU_CLOSE, IDS_LAUNCHER_CONTEXT_MENU_CLOSE);
+ AddSeparator(ui::NORMAL_SEPARATOR);
+ AddShelfOptionsMenu();
+}
+
+bool ArcLauncherContextMenu::IsCommandIdEnabled(int command_id) const {
+ if (command_id == MENU_OPEN_NEW)
+ return true;
+ return LauncherContextMenu::IsCommandIdEnabled(command_id);
+}
« no previous file with comments | « chrome/browser/ui/ash/launcher/arc_launcher_context_menu.h ('k') | chrome/browser/ui/ash/launcher/launcher_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698