| 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_pref_store.h" | 5 #include "chrome/browser/supervised_user/supervised_user_pref_store.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 bool SupervisedUserPrefStore::IsInitializationComplete() const { | 106 bool SupervisedUserPrefStore::IsInitializationComplete() const { |
| 107 return !!prefs_; | 107 return !!prefs_; |
| 108 } | 108 } |
| 109 | 109 |
| 110 SupervisedUserPrefStore::~SupervisedUserPrefStore() { | 110 SupervisedUserPrefStore::~SupervisedUserPrefStore() { |
| 111 } | 111 } |
| 112 | 112 |
| 113 void SupervisedUserPrefStore::OnNewSettingsAvailable( | 113 void SupervisedUserPrefStore::OnNewSettingsAvailable( |
| 114 const base::DictionaryValue* settings) { | 114 const base::DictionaryValue* settings) { |
| 115 scoped_ptr<PrefValueMap> old_prefs = std::move(prefs_); | 115 std::unique_ptr<PrefValueMap> old_prefs = std::move(prefs_); |
| 116 prefs_.reset(new PrefValueMap); | 116 prefs_.reset(new PrefValueMap); |
| 117 if (settings) { | 117 if (settings) { |
| 118 // Set hardcoded prefs and defaults. | 118 // Set hardcoded prefs and defaults. |
| 119 prefs_->SetBoolean(prefs::kAllowDeletingBrowserHistory, false); | 119 prefs_->SetBoolean(prefs::kAllowDeletingBrowserHistory, false); |
| 120 prefs_->SetInteger(prefs::kDefaultSupervisedUserFilteringBehavior, | 120 prefs_->SetInteger(prefs::kDefaultSupervisedUserFilteringBehavior, |
| 121 SupervisedUserURLFilter::ALLOW); | 121 SupervisedUserURLFilter::ALLOW); |
| 122 prefs_->SetBoolean(prefs::kForceGoogleSafeSearch, true); | 122 prefs_->SetBoolean(prefs::kForceGoogleSafeSearch, true); |
| 123 prefs_->SetBoolean(prefs::kForceYouTubeSafetyMode, true); | 123 prefs_->SetBoolean(prefs::kForceYouTubeSafetyMode, true); |
| 124 prefs_->SetBoolean(prefs::kHideWebStoreIcon, true); | 124 prefs_->SetBoolean(prefs::kHideWebStoreIcon, true); |
| 125 prefs_->SetInteger(prefs::kIncognitoModeAvailability, | 125 prefs_->SetInteger(prefs::kIncognitoModeAvailability, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 168 } |
| 169 | 169 |
| 170 // Callback to unsubscribe from the supervised user settings service. | 170 // Callback to unsubscribe from the supervised user settings service. |
| 171 void SupervisedUserPrefStore::Observe( | 171 void SupervisedUserPrefStore::Observe( |
| 172 int type, | 172 int type, |
| 173 const content::NotificationSource& src, | 173 const content::NotificationSource& src, |
| 174 const content::NotificationDetails& details) { | 174 const content::NotificationDetails& details) { |
| 175 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); | 175 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); |
| 176 user_settings_subscription_.reset(); | 176 user_settings_subscription_.reset(); |
| 177 } | 177 } |
| OLD | NEW |