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

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

Issue 2755073003: [Merge M58] arc: Reactivate OptIn flow on clicking Play Store. (Closed)
Patch Set: update unit_tests expectation for M58 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 49b6f04bdf062d1d444ff68f48c80ec53804ce3b..74a5acde6524fc74072e75a479a73d33f65236c6 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,20 @@ 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.
+ // TODO (khmel): Consider finding the better way handling this.
+ ArcSessionManager* arc_session_manager = ArcSessionManager::Get();
+ // |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);
« no previous file with comments | « chrome/browser/chromeos/arc/arc_session_manager_unittest.cc ('k') | chrome/browser/ui/app_list/arc/arc_app_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698