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

Unified Diff: chrome/browser/chromeos/arc/arc_util.cc

Issue 2739323004: arc: Reactivate OptIn flow on clicking Play Store. (Closed)
Patch Set: Created 3 years, 9 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/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..cbb661960109456a7fff386870abbbd5825f6198 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,15 @@ 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.
+ if (enabled)
+ ArcSessionManager::Get()->RequestEnable();
+ else
+ ArcSessionManager::Get()->RequestDisable();
return;
}
profile->GetPrefs()->SetBoolean(prefs::kArcEnabled, enabled);

Powered by Google App Engine
This is Rietveld 408576698