Chromium Code Reviews| 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..2edc973aca57eb71c3feb8a59672a208dadd7df2 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,14 @@ |
| // 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" |
| + |
| #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 +27,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( |
|
Luis Héctor Chávez
2017/02/21 16:50:02
nit: = base::MakeUnique<..>(..);
hidehiko
2017/02/21 17:25:14
Done.
|
| + new ArcAppLauncher(profile, arc::kPlayStoreAppId, true)); |
| } |
| return ash::SHELF_ACTION_NONE; |