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

Unified Diff: chrome/test/base/testing_profile.cc

Issue 1078713002: Supervised users: Re-check ManagementPolicy when ProfileIsSupervised changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: shaving the yak Created 5 years, 8 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
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/testing_profile.cc
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index 12ecbe99e8f953e20b415a299160ee79500a9a04..6e99b1c336dfb4e0f07e31bd7fa68072591459f6 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -382,7 +382,6 @@ TestingProfile::TestingProfile(
force_incognito_(false),
original_profile_(parent),
guest_session_(guest_session),
- supervised_user_id_(supervised_user_id),
last_session_exited_cleanly_(true),
#if defined(ENABLE_EXTENSIONS)
extension_special_storage_policy_(extension_policy),
@@ -420,6 +419,8 @@ TestingProfile::TestingProfile(
} else {
FinishInit();
}
+
+ SetSupervisedUserId(supervised_user_id);
}
void TestingProfile::CreateTempProfileDir() {
@@ -766,6 +767,14 @@ Profile* TestingProfile::GetOriginalProfile() {
return this;
}
+void TestingProfile::SetSupervisedUserId(const std::string& id) {
+ supervised_user_id_ = id;
+ if (!id.empty())
+ GetPrefs()->SetString(prefs::kSupervisedUserId, id);
+ else
+ GetPrefs()->ClearPref(prefs::kSupervisedUserId);
+}
+
bool TestingProfile::IsSupervised() {
return !supervised_user_id_.empty();
}
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698