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/extensions/extension_management_test_util.h" | 5 #include "chrome/browser/extensions/extension_management_test_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "components/crx_file/id_util.h" | 10 #include "components/crx_file/id_util.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 const base::DictionaryValue* ExtensionManagementPrefUpdaterBase::GetPref() { | 208 const base::DictionaryValue* ExtensionManagementPrefUpdaterBase::GetPref() { |
209 return pref_.get(); | 209 return pref_.get(); |
210 } | 210 } |
211 | 211 |
212 // Private section functions --------------------------------------------------- | 212 // Private section functions --------------------------------------------------- |
213 | 213 |
214 void ExtensionManagementPrefUpdaterBase::SetPref(base::DictionaryValue* pref) { | 214 void ExtensionManagementPrefUpdaterBase::SetPref(base::DictionaryValue* pref) { |
215 pref_.reset(pref); | 215 pref_.reset(pref); |
216 } | 216 } |
217 | 217 |
218 scoped_ptr<base::DictionaryValue> | 218 std::unique_ptr<base::DictionaryValue> |
219 ExtensionManagementPrefUpdaterBase::TakePref() { | 219 ExtensionManagementPrefUpdaterBase::TakePref() { |
220 return std::move(pref_); | 220 return std::move(pref_); |
221 } | 221 } |
222 | 222 |
223 void ExtensionManagementPrefUpdaterBase::ClearList(const std::string& path) { | 223 void ExtensionManagementPrefUpdaterBase::ClearList(const std::string& path) { |
224 pref_->Set(path, new base::ListValue()); | 224 pref_->Set(path, new base::ListValue()); |
225 } | 225 } |
226 | 226 |
227 void ExtensionManagementPrefUpdaterBase::AddStringToList( | 227 void ExtensionManagementPrefUpdaterBase::AddStringToList( |
228 const std::string& path, | 228 const std::string& path, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 ExtensionManagementPolicyUpdater::~ExtensionManagementPolicyUpdater() { | 263 ExtensionManagementPolicyUpdater::~ExtensionManagementPolicyUpdater() { |
264 policies_->Get(policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, | 264 policies_->Get(policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, |
265 std::string())) | 265 std::string())) |
266 .Set(policy::key::kExtensionSettings, policy::POLICY_LEVEL_MANDATORY, | 266 .Set(policy::key::kExtensionSettings, policy::POLICY_LEVEL_MANDATORY, |
267 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, | 267 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, |
268 TakePref().release(), nullptr); | 268 TakePref().release(), nullptr); |
269 provider_->UpdatePolicy(std::move(policies_)); | 269 provider_->UpdatePolicy(std::move(policies_)); |
270 } | 270 } |
271 | 271 |
272 } // namespace extensions | 272 } // namespace extensions |
OLD | NEW |