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

Side by Side Diff: chrome/browser/chromeos/extensions/device_local_account_external_policy_loader.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chromeos/extensions/device_local_account_external_polic y_loader.h" 5 #include "chrome/browser/chromeos/extensions/device_local_account_external_polic y_loader.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 DeviceLocalAccountExternalPolicyLoader::GetExternalCacheForTesting() { 86 DeviceLocalAccountExternalPolicyLoader::GetExternalCacheForTesting() {
87 return external_cache_.get(); 87 return external_cache_.get();
88 } 88 }
89 89
90 DeviceLocalAccountExternalPolicyLoader:: 90 DeviceLocalAccountExternalPolicyLoader::
91 ~DeviceLocalAccountExternalPolicyLoader() { 91 ~DeviceLocalAccountExternalPolicyLoader() {
92 DCHECK(!external_cache_); 92 DCHECK(!external_cache_);
93 } 93 }
94 94
95 void DeviceLocalAccountExternalPolicyLoader::UpdateExtensionListFromStore() { 95 void DeviceLocalAccountExternalPolicyLoader::UpdateExtensionListFromStore() {
96 scoped_ptr<base::DictionaryValue> prefs(new base::DictionaryValue); 96 std::unique_ptr<base::DictionaryValue> prefs(new base::DictionaryValue);
97 const policy::PolicyMap& policy_map = store_->policy_map(); 97 const policy::PolicyMap& policy_map = store_->policy_map();
98 // TODO(binjin): Use two policy handlers here after 98 // TODO(binjin): Use two policy handlers here after
99 // ExtensionManagementPolicyHandler is introduced. 99 // ExtensionManagementPolicyHandler is introduced.
100 extensions::ExtensionInstallForcelistPolicyHandler policy_handler; 100 extensions::ExtensionInstallForcelistPolicyHandler policy_handler;
101 if (policy_handler.CheckPolicySettings(policy_map, NULL)) { 101 if (policy_handler.CheckPolicySettings(policy_map, NULL)) {
102 PrefValueMap pref_value_map; 102 PrefValueMap pref_value_map;
103 policy_handler.ApplyPolicySettings(policy_map, &pref_value_map); 103 policy_handler.ApplyPolicySettings(policy_map, &pref_value_map);
104 const base::Value* value = NULL; 104 const base::Value* value = NULL;
105 const base::DictionaryValue* dict = NULL; 105 const base::DictionaryValue* dict = NULL;
106 if (pref_value_map.GetValue(extensions::pref_names::kInstallForceList, 106 if (pref_value_map.GetValue(extensions::pref_names::kInstallForceList,
107 &value) && 107 &value) &&
108 value->GetAsDictionary(&dict)) { 108 value->GetAsDictionary(&dict)) {
109 prefs.reset(dict->DeepCopy()); 109 prefs.reset(dict->DeepCopy());
110 } 110 }
111 } 111 }
112 112
113 external_cache_->UpdateExtensionsList(std::move(prefs)); 113 external_cache_->UpdateExtensionsList(std::move(prefs));
114 } 114 }
115 115
116 } // namespace chromeos 116 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698