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 |
index f0afccabc750f6a8c70139531014e1f02234967f..76e5a0dd5bb4c3f21c2a2f33dafa9eeab264ab53 100644 |
--- 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 |
@@ -2,13 +2,13 @@ |
// 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_session_manager.h" |
+#include "chrome/browser/ui/ash/launcher/arc_playstore_shortcut_launcher_item_controller.h" |
Yusuke Sato
2017/02/17 22:27:09
nit: space between L5 and L6?
hidehiko
2017/02/20 18:18:44
Done.
|
#include "chrome/browser/chromeos/arc/arc_support_host.h" |
+#include "chrome/browser/chromeos/arc/arc_util.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_list_prefs.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:: |
@@ -26,25 +26,23 @@ ash::ShelfAction ArcPlaystoreShortcutLauncherItemController::ItemSelected( |
int event_flags, |
int64_t display_id, |
ash::ShelfLaunchSource source) { |
- arc::ArcSessionManager* arc_session_manager = arc::ArcSessionManager::Get(); |
- DCHECK(arc_session_manager); |
- DCHECK(arc_session_manager->IsAllowed()); |
- |
- ArcAppListPrefs* arc_app_prefs = |
- ArcAppListPrefs::Get(controller()->profile()); |
+ Profile* profile = controller()->profile(); |
+ ArcAppListPrefs* arc_app_prefs = ArcAppListPrefs::Get(profile); |
DCHECK(arc_app_prefs); |
- const bool arc_was_enabled = arc_session_manager->IsArcPlayStoreEnabled(); |
- arc_session_manager->SetArcPlayStoreEnabled(true); |
+ const bool play_store_was_enabled = |
+ arc::IsArcPlayStoreEnabledForProfile(profile); |
+ arc::SetArcPlayStoreEnabledForProfile(profile, true); |
// Deferred launcher. |
- if (arc_app_prefs->IsRegistered(arc::kPlayStoreAppId) && arc_was_enabled) { |
+ if (arc_app_prefs->IsRegistered(arc::kPlayStoreAppId) && |
+ play_store_was_enabled) { |
// Known apps can be launched directly or deferred. |
- arc::LaunchApp(controller()->profile(), arc::kPlayStoreAppId, true); |
+ arc::LaunchApp(profile, arc::kPlayStoreAppId, true); |
} else { |
// Launch Play Store once its app appears. |
- playstore_launcher_.reset(new ArcAppLauncher(controller()->profile(), |
- arc::kPlayStoreAppId, true)); |
+ playstore_launcher_.reset( |
+ new ArcAppLauncher(profile, arc::kPlayStoreAppId, true)); |
} |
return ash::SHELF_ACTION_NONE; |