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 de722a70e63ff37ee2cf24ba237e3a0f4fc0cf71..e8a9b004753e7e9a4580b2285a489f5f06144fbb 100644 |
--- a/chrome/browser/chromeos/arc/arc_util.cc |
+++ b/chrome/browser/chromeos/arc/arc_util.cc |
@@ -9,7 +9,9 @@ |
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
#include "chrome/browser/chromeos/profiles/profile_helper.h" |
#include "chrome/browser/profiles/profile.h" |
+#include "chrome/common/pref_names.h" |
#include "components/arc/arc_util.h" |
+#include "components/prefs/pref_service.h" |
#include "components/user_manager/user.h" |
#include "components/user_manager/user_manager.h" |
@@ -96,4 +98,23 @@ void DisallowArcForTesting() { |
g_disallow_for_testing = true; |
} |
+bool IsArcPlayStoreEnabledForProfile(const Profile* profile) { |
+ return IsArcAllowedForProfile(profile) && |
+ profile->GetPrefs()->GetBoolean(prefs::kArcEnabled); |
+} |
+ |
+bool IsArcPlayStoreEnabledPreferenceManagedForProfile(const Profile* profile) { |
+ DCHECK(IsArcAllowedForProfile(profile)); |
+ return profile->GetPrefs()->IsManagedPreference(prefs::kArcEnabled); |
+} |
+ |
+void SetArcPlayStoreEnabledForProfile(Profile* profile, bool enabled) { |
+ DCHECK(IsArcAllowedForProfile(profile)); |
+ if (IsArcPlayStoreEnabledPreferenceManagedForProfile(profile)) { |
+ VLOG(1) << "Whether Google Play Store is enabled is managed. Do nothing."; |
xiyuan
2017/02/17 17:45:40
nit: Whether Google Play Store is enabled is manag
hidehiko
2017/02/20 18:18:44
Done.
|
+ return; |
+ } |
+ profile->GetPrefs()->SetBoolean(prefs::kArcEnabled, enabled); |
+} |
+ |
} // namespace arc |