OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/chromeos/arc/arc_auth_service.h" |
| 6 #include "chrome/browser/chromeos/arc/arc_support_host.h" |
| 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/ui/app_list/arc/arc_app_launcher.h" |
| 9 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
| 10 #include "chrome/browser/ui/ash/launcher/arc_playstore_shortcut_launcher_item_co
ntroller.h" |
| 11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 12 |
| 13 ArcPlaystoreShortcutLauncherItemController:: |
| 14 ArcPlaystoreShortcutLauncherItemController( |
| 15 ChromeLauncherController* controller) |
| 16 : AppShortcutLauncherItemController(ArcSupportHost::kHostAppId, |
| 17 controller) {} |
| 18 |
| 19 ArcPlaystoreShortcutLauncherItemController:: |
| 20 ~ArcPlaystoreShortcutLauncherItemController() {} |
| 21 |
| 22 ash::ShelfItemDelegate::PerformedAction |
| 23 ArcPlaystoreShortcutLauncherItemController::Activate(ash::LaunchSource source) { |
| 24 arc::ArcAuthService* auth_service = arc::ArcAuthService::Get(); |
| 25 DCHECK(auth_service->IsAllowed()); |
| 26 |
| 27 if (!auth_service->IsArcEnabled()) |
| 28 auth_service->EnableArc(); |
| 29 |
| 30 // Deferred launcher. |
| 31 playstore_launcher_.reset( |
| 32 new ArcAppLauncher(controller()->profile(), arc::kPlayStoreAppId, true)); |
| 33 |
| 34 return kNoAction; |
| 35 } |
OLD | NEW |