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

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

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/extensions/policy_handlers.h" 5 #include "chrome/browser/extensions/policy_handlers.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 IDS_POLICY_TYPE_ERROR, 84 IDS_POLICY_TYPE_ERROR,
85 ValueTypeToString(base::Value::TYPE_STRING)); 85 ValueTypeToString(base::Value::TYPE_STRING));
86 continue; 86 continue;
87 } 87 }
88 if (!(allow_wildcards_ && id == "*") && !crx_file::id_util::IdIsValid(id)) { 88 if (!(allow_wildcards_ && id == "*") && !crx_file::id_util::IdIsValid(id)) {
89 errors->AddError(policy_name(), 89 errors->AddError(policy_name(),
90 entry - list_value->begin(), 90 entry - list_value->begin(),
91 IDS_POLICY_VALUE_FORMAT_ERROR); 91 IDS_POLICY_VALUE_FORMAT_ERROR);
92 continue; 92 continue;
93 } 93 }
94 filtered_list->Append(new base::StringValue(id)); 94 filtered_list->AppendString(id);
95 } 95 }
96 96
97 if (extension_ids) 97 if (extension_ids)
98 *extension_ids = std::move(filtered_list); 98 *extension_ids = std::move(filtered_list);
99 99
100 return true; 100 return true;
101 } 101 }
102 102
103 // ExtensionInstallForcelistPolicyHandler implementation ----------------------- 103 // ExtensionInstallForcelistPolicyHandler implementation -----------------------
104 104
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 void ExtensionSettingsPolicyHandler::ApplyPolicySettings( 320 void ExtensionSettingsPolicyHandler::ApplyPolicySettings(
321 const policy::PolicyMap& policies, 321 const policy::PolicyMap& policies,
322 PrefValueMap* prefs) { 322 PrefValueMap* prefs) {
323 std::unique_ptr<base::Value> policy_value; 323 std::unique_ptr<base::Value> policy_value;
324 if (!CheckAndGetValue(policies, NULL, &policy_value) || !policy_value) 324 if (!CheckAndGetValue(policies, NULL, &policy_value) || !policy_value)
325 return; 325 return;
326 prefs->SetValue(pref_names::kExtensionManagement, std::move(policy_value)); 326 prefs->SetValue(pref_names::kExtensionManagement, std::move(policy_value));
327 } 327 }
328 328
329 } // namespace extensions 329 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/menu_manager_unittest.cc ('k') | chrome/browser/extensions/policy_handlers_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698