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

Unified Diff: chrome/browser/ui/ash/launcher/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/launcher_context_menu.cc
diff --git a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
index 907c16381c4327076be7237ebb0d6fa8f086f8f1..9a6cad0db4aca6c69eec31893b008ae118b9d2c5 100644
--- a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
+++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
@@ -24,6 +24,11 @@
#include "grit/ash_strings.h"
#include "ui/base/l10n/l10n_util.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
+#include "chrome/browser/ui/ash/launcher/arc_launcher_context_menu.h"
+#endif // defined(OS_CHROMEOS)
+
namespace {
// Returns true if the user can modify the |shelf|'s auto-hide behavior.
@@ -45,6 +50,15 @@ LauncherContextMenu* LauncherContextMenu::Create(
if (!item || item->id == 0)
return new DesktopShellLauncherContextMenu(controller, item, shelf);
+// Create ArcLauncherContextMenu if the item is an Arc app.
+#if defined(OS_CHROMEOS)
+ const std::string& app_id = controller->GetAppIDForShelfID(item->id);
+ ArcAppListPrefs* arc_prefs = ArcAppListPrefs::Get(controller->profile());
+ DCHECK(arc_prefs);
+ if (arc_prefs->IsRegistered(app_id))
+ return new ArcLauncherContextMenu(controller, item, shelf);
+#endif // defined(OS_CHROMEOS)
+
// Create ExtensionLauncherContextMenu for the item.
return new ExtensionLauncherContextMenu(controller, item, shelf);
}

Powered by Google App Engine
This is Rietveld 408576698