OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/supervised_user/supervised_user_service.h" | 5 #include "chrome/browser/supervised_user/supervised_user_service.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 // new permissions, we update the approved_version. | 1173 // new permissions, we update the approved_version. |
1174 if (!extension_prefs->HasDisableReason( | 1174 if (!extension_prefs->HasDisableReason( |
1175 id, Extension::DISABLE_PERMISSIONS_INCREASE) && | 1175 id, Extension::DISABLE_PERMISSIONS_INCREASE) && |
1176 approved_extensions_map_.count(id) > 0 && | 1176 approved_extensions_map_.count(id) > 0 && |
1177 approved_extensions_map_[id] < version) { | 1177 approved_extensions_map_[id] < version) { |
1178 approved_extensions_map_[id] = version; | 1178 approved_extensions_map_[id] = version; |
1179 | 1179 |
1180 std::string key = SupervisedUserSettingsService::MakeSplitSettingKey( | 1180 std::string key = SupervisedUserSettingsService::MakeSplitSettingKey( |
1181 supervised_users::kApprovedExtensions, id); | 1181 supervised_users::kApprovedExtensions, id); |
1182 std::unique_ptr<base::Value> version_value( | 1182 std::unique_ptr<base::Value> version_value( |
1183 new base::StringValue(version.GetString())); | 1183 new base::Value(version.GetString())); |
1184 GetSettingsService()->UpdateSetting(key, std::move(version_value)); | 1184 GetSettingsService()->UpdateSetting(key, std::move(version_value)); |
1185 } | 1185 } |
1186 // Upon extension update, the approved version may (or may not) match the | 1186 // Upon extension update, the approved version may (or may not) match the |
1187 // installed one. Therefore, a change in extension state might be required. | 1187 // installed one. Therefore, a change in extension state might be required. |
1188 ChangeExtensionStateIfNecessary(id); | 1188 ChangeExtensionStateIfNecessary(id); |
1189 } | 1189 } |
1190 | 1190 |
1191 void SupervisedUserService::UpdateApprovedExtensions() { | 1191 void SupervisedUserService::UpdateApprovedExtensions() { |
1192 const base::DictionaryValue* dict = profile_->GetPrefs()->GetDictionary( | 1192 const base::DictionaryValue* dict = profile_->GetPrefs()->GetDictionary( |
1193 prefs::kSupervisedUserApprovedExtensions); | 1193 prefs::kSupervisedUserApprovedExtensions); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 content::RecordAction(UserMetricsAction("ManagedUsers_SwitchProfile")); | 1311 content::RecordAction(UserMetricsAction("ManagedUsers_SwitchProfile")); |
1312 | 1312 |
1313 is_profile_active_ = profile_became_active; | 1313 is_profile_active_ = profile_became_active; |
1314 } | 1314 } |
1315 #endif // !defined(OS_ANDROID) | 1315 #endif // !defined(OS_ANDROID) |
1316 | 1316 |
1317 void SupervisedUserService::OnSiteListUpdated() { | 1317 void SupervisedUserService::OnSiteListUpdated() { |
1318 for (SupervisedUserServiceObserver& observer : observer_list_) | 1318 for (SupervisedUserServiceObserver& observer : observer_list_) |
1319 observer.OnURLFilterChanged(); | 1319 observer.OnURLFilterChanged(); |
1320 } | 1320 } |
OLD | NEW |