| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/login/multi_profile_user_controller.h" | 5 #include "chrome/browser/chromeos/login/multi_profile_user_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/prefs/pref_change_registrar.h" | 9 #include "base/prefs/pref_change_registrar.h" |
| 10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 void MultiProfileUserController::RemoveCachedValues( | 138 void MultiProfileUserController::RemoveCachedValues( |
| 139 const std::string& user_email) { | 139 const std::string& user_email) { |
| 140 DictionaryPrefUpdate update(local_state_, | 140 DictionaryPrefUpdate update(local_state_, |
| 141 prefs::kCachedMultiProfileUserBehavior); | 141 prefs::kCachedMultiProfileUserBehavior); |
| 142 update->RemoveWithoutPathExpansion(user_email, NULL); | 142 update->RemoveWithoutPathExpansion(user_email, NULL); |
| 143 policy::PolicyCertServiceFactory::ClearUsedPolicyCertificates(user_email); | 143 policy::PolicyCertServiceFactory::ClearUsedPolicyCertificates(user_email); |
| 144 } | 144 } |
| 145 | 145 |
| 146 std::string MultiProfileUserController::GetCachedValue( | 146 std::string MultiProfileUserController::GetCachedValue( |
| 147 const std::string& user_email) const { | 147 const std::string& user_email) const { |
| 148 const DictionaryValue* dict = | 148 const base::DictionaryValue* dict = |
| 149 local_state_->GetDictionary(prefs::kCachedMultiProfileUserBehavior); | 149 local_state_->GetDictionary(prefs::kCachedMultiProfileUserBehavior); |
| 150 std::string value; | 150 std::string value; |
| 151 if (dict && dict->GetStringWithoutPathExpansion(user_email, &value)) | 151 if (dict && dict->GetStringWithoutPathExpansion(user_email, &value)) |
| 152 return SanitizeBehaviorValue(value); | 152 return SanitizeBehaviorValue(value); |
| 153 | 153 |
| 154 return std::string(kBehaviorUnrestricted); | 154 return std::string(kBehaviorUnrestricted); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void MultiProfileUserController::SetCachedValue( | 157 void MultiProfileUserController::SetCachedValue( |
| 158 const std::string& user_email, | 158 const std::string& user_email, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 181 | 181 |
| 182 PrefService* prefs = user_profile->GetPrefs(); | 182 PrefService* prefs = user_profile->GetPrefs(); |
| 183 const std::string behavior = | 183 const std::string behavior = |
| 184 prefs->GetString(prefs::kMultiProfileUserBehavior); | 184 prefs->GetString(prefs::kMultiProfileUserBehavior); |
| 185 SetCachedValue(user_email, behavior); | 185 SetCachedValue(user_email, behavior); |
| 186 | 186 |
| 187 CheckSessionUsers(); | 187 CheckSessionUsers(); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace chromeos | 190 } // namespace chromeos |
| OLD | NEW |