TestingProfileManager::TestingProfileManager(TestingBrowserProcess* process)
: called_set_up_(false),
browser_process_(process),
- local_state_(process) {
+ local_state_(process),
+ profile_manager_(NULL) {
}
TestingProfileManager::~TestingProfileManager() {
scoped_ptr<PrefServiceSyncable> prefs,
const base::string16& user_name,
int avatar_id,
- const std::string& managed_user_id,
+ const std::string& supervised_user_id,
const TestingProfile::TestingFactories& factories) {
DCHECK(called_set_up_);
TestingProfile::Builder builder;
builder.SetPath(profile_path);
builder.SetPrefService(prefs.Pass());
- builder.SetManagedUserId(managed_user_id);
+ builder.SetSupervisedUserId(supervised_user_id);
for (TestingProfile::TestingFactories::const_iterator it = factories.begin();
it != factories.end(); ++it) {
ProfileInfoCache& cache = profile_manager_->GetProfileInfoCache();
size_t index = cache.GetIndexOfProfileWithPath(profile_path);
cache.SetAvatarIconOfProfileAtIndex(index, avatar_id);
- cache.SetManagedUserIdOfProfileAtIndex(index, managed_user_id);
+ cache.SetSupervisedUserIdOfProfileAtIndex(index, supervised_user_id);
// SetNameOfProfileAtIndex may reshuffle the list of profiles, so we do it
// last.
cache.SetNameOfProfileAtIndex(index, user_name);
profile_manager_->profiles_info_.erase(profile->GetPath());
}
+void TestingProfileManager::DeleteAllTestingProfiles() {
+ for (TestingProfilesMap::iterator it = testing_profiles_.begin();
+ it != testing_profiles_.end(); ++it) {
+ TestingProfile* profile = it->second;
+ ProfileInfoCache& cache = profile_manager_->GetProfileInfoCache();
+ cache.DeleteProfileFromCache(profile->GetPath());
+ }
+ testing_profiles_.clear();
+}
+
+
void TestingProfileManager::DeleteGuestProfile() {
DCHECK(called_set_up_);