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

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

Issue 1973603002: arc: Make Play Store item persistance in shelf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 7 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_playstore_shortcut_launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/arc_playstore_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/arc_playstore_shortcut_launcher_item_controller.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d3083622bda90fd18d1dc07248e72064793f6525
--- /dev/null
+++ b/chrome/browser/ui/ash/launcher/arc_playstore_shortcut_launcher_item_controller.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/chromeos/arc/arc_auth_service.h"
+#include "chrome/browser/chromeos/arc/arc_support_host.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/app_list/arc/arc_app_launcher.h"
+#include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
+#include "chrome/browser/ui/ash/launcher/arc_playstore_shortcut_launcher_item_controller.h"
+#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
+
+ArcPlaystoreShortcutLauncherItemController::
+ ArcPlaystoreShortcutLauncherItemController(
+ ChromeLauncherController* controller)
+ : AppShortcutLauncherItemController(ArcSupportHost::kHostAppId,
+ controller) {}
+
+ArcPlaystoreShortcutLauncherItemController::
+ ~ArcPlaystoreShortcutLauncherItemController() {}
+
+ash::ShelfItemDelegate::PerformedAction
+ArcPlaystoreShortcutLauncherItemController::Activate(ash::LaunchSource source) {
+ arc::ArcAuthService* auth_service = arc::ArcAuthService::Get();
+ DCHECK(auth_service->IsAllowed());
+
+ if (!auth_service->IsArcEnabled())
+ auth_service->EnableArc();
+
+ // Deferred launcher.
+ playstore_launcher_.reset(
+ new ArcAppLauncher(controller()->profile(), arc::kPlayStoreAppId, true));
+
+ return kNoAction;
+}

Powered by Google App Engine
This is Rietveld 408576698