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

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: 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..9e181367562dbd2ba3dc00f906dc11a4b8dfc35d 100644
--- a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
+++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
@@ -14,6 +14,7 @@
#include "build/build_config.h"
#include "chrome/browser/fullscreen.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/ash/launcher/arc_launcher_context_menu.h"
stevenjb 2016/04/07 18:58:12 If we are only using this on Chrome OS then we sho
lgcheng 2016/04/07 19:40:51 Done.
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
#include "chrome/browser/ui/ash/launcher/desktop_shell_launcher_context_menu.h"
#include "chrome/browser/ui/ash/launcher/extension_launcher_context_menu.h"
@@ -24,6 +25,10 @@
#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"
+#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