Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: chrome/browser/extensions/extension_management_test_util.cc

Issue 1940153002: Use std::unique_ptr to express ownership of base::Value in PolicyMap::Entry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another-fix Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698