Chromium Code Reviews| Index: chrome/browser/chromeos/arc/arc_util.cc |
| diff --git a/chrome/browser/chromeos/arc/arc_util.cc b/chrome/browser/chromeos/arc/arc_util.cc |
| index f91cebc8f01f4e6b26317ed5791c74b573cecdc8..d19569b3e36b44ba745be637e3ad99af26463392 100644 |
| --- a/chrome/browser/chromeos/arc/arc_util.cc |
| +++ b/chrome/browser/chromeos/arc/arc_util.cc |
| @@ -5,6 +5,7 @@ |
| #include "chrome/browser/chromeos/arc/arc_util.h" |
| #include "base/logging.h" |
| +#include "chrome/browser/chromeos/arc/arc_session_manager.h" |
| #include "chrome/browser/chromeos/login/user_flow.h" |
| #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| @@ -114,8 +115,19 @@ bool IsArcPlayStoreEnabledPreferenceManagedForProfile(const Profile* profile) { |
| void SetArcPlayStoreEnabledForProfile(Profile* profile, bool enabled) { |
| DCHECK(IsArcAllowedForProfile(profile)); |
| if (IsArcPlayStoreEnabledPreferenceManagedForProfile(profile)) { |
| - VLOG(1) << "Do nothing, since the Google-Play-Store-enabled pref is " |
| - << "managed."; |
| + VLOG(1) << "Google-Play-Store-enabled pref is managed. Request to " |
| + << (enabled ? "enable" : "disable") << " Play Store is not stored"; |
| + // Need update ARC session manager manually for managed case in order to |
| + // keep its state up to date, otherwise it may stuck with enabling |
| + // request. |
| + ArcSessionManager* arc_session_manager = ArcSessionManager::Get(); |
|
hidehiko
2017/03/13 21:46:47
QQ: If this is only for launcher icon click case,
khmel
2017/03/13 21:58:49
This is not only for launcher item case. My first
hidehiko
2017/03/15 00:45:00
If this is short term fix that's ok, but please ad
khmel
2017/03/15 01:33:28
TODO added, IsArcPlayStoreEnabledForProfile is alw
|
| + // |arc_session_manager| can be nullptr in unit_tests. |
| + if (!arc_session_manager) |
| + return; |
| + if (enabled) |
| + arc_session_manager->RequestEnable(); |
| + else |
| + arc_session_manager->RequestDisable(); |
| return; |
| } |
| profile->GetPrefs()->SetBoolean(prefs::kArcEnabled, enabled); |