| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 std::string())) | 254 std::string())) |
| 255 .GetValue(policy::key::kExtensionSettings); | 255 .GetValue(policy::key::kExtensionSettings); |
| 256 const base::DictionaryValue* dict_value = nullptr; | 256 const base::DictionaryValue* dict_value = nullptr; |
| 257 if (policy_value && policy_value->GetAsDictionary(&dict_value)) | 257 if (policy_value && policy_value->GetAsDictionary(&dict_value)) |
| 258 SetPref(dict_value->DeepCopy()); | 258 SetPref(dict_value->DeepCopy()); |
| 259 else | 259 else |
| 260 SetPref(new base::DictionaryValue); | 260 SetPref(new base::DictionaryValue); |
| 261 } | 261 } |
| 262 | 262 |
| 263 ExtensionManagementPolicyUpdater::~ExtensionManagementPolicyUpdater() { | 263 ExtensionManagementPolicyUpdater::~ExtensionManagementPolicyUpdater() { |
| 264 policies_->Get(policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, | 264 policies_ |
| 265 std::string())) | 265 ->Get( |
| 266 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, std::string())) |
| 266 .Set(policy::key::kExtensionSettings, policy::POLICY_LEVEL_MANDATORY, | 267 .Set(policy::key::kExtensionSettings, policy::POLICY_LEVEL_MANDATORY, |
| 267 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, | 268 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, TakePref(), |
| 268 TakePref().release(), nullptr); | 269 nullptr); |
| 269 provider_->UpdatePolicy(std::move(policies_)); | 270 provider_->UpdatePolicy(std::move(policies_)); |
| 270 } | 271 } |
| 271 | 272 |
| 272 } // namespace extensions | 273 } // namespace extensions |
| OLD | NEW |