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

Side by Side Diff: components/search_engines/default_search_policy_handler.cc

Issue 2231753002: components: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more call site Created 4 years, 4 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 "components/search_engines/default_search_policy_handler.h" 5 #include "components/search_engines/default_search_policy_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } else { 190 } else {
191 handlers_.push_back(new SimplePolicyHandler( 191 handlers_.push_back(new SimplePolicyHandler(
192 policy_name, 192 policy_name,
193 kDefaultSearchPolicyMap[i].preference_path, 193 kDefaultSearchPolicyMap[i].preference_path,
194 kDefaultSearchPolicyMap[i].value_type)); 194 kDefaultSearchPolicyMap[i].value_type));
195 } 195 }
196 } 196 }
197 } 197 }
198 198
199 DefaultSearchPolicyHandler::~DefaultSearchPolicyHandler() { 199 DefaultSearchPolicyHandler::~DefaultSearchPolicyHandler() {
200 STLDeleteElements(&handlers_); 200 base::STLDeleteElements(&handlers_);
201 } 201 }
202 202
203 bool DefaultSearchPolicyHandler::CheckPolicySettings(const PolicyMap& policies, 203 bool DefaultSearchPolicyHandler::CheckPolicySettings(const PolicyMap& policies,
204 PolicyErrorMap* errors) { 204 PolicyErrorMap* errors) {
205 if (!CheckIndividualPolicies(policies, errors)) 205 if (!CheckIndividualPolicies(policies, errors))
206 return false; 206 return false;
207 207
208 if (DefaultSearchProviderIsDisabled(policies)) { 208 if (DefaultSearchProviderIsDisabled(policies)) {
209 // Add an error for all specified default search policies except 209 // Add an error for all specified default search policies except
210 // DefaultSearchProviderEnabled. 210 // DefaultSearchProviderEnabled.
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 void DefaultSearchPolicyHandler::EnsureListPrefExists( 366 void DefaultSearchPolicyHandler::EnsureListPrefExists(
367 PrefValueMap* prefs, 367 PrefValueMap* prefs,
368 const std::string& path) { 368 const std::string& path) {
369 base::Value* value; 369 base::Value* value;
370 base::ListValue* list_value; 370 base::ListValue* list_value;
371 if (!prefs->GetValue(path, &value) || !value->GetAsList(&list_value)) 371 if (!prefs->GetValue(path, &value) || !value->GetAsList(&list_value))
372 prefs->SetValue(path, base::WrapUnique(new base::ListValue())); 372 prefs->SetValue(path, base::WrapUnique(new base::ListValue()));
373 } 373 }
374 374
375 } // namespace policy 375 } // namespace policy
OLDNEW
« no previous file with comments | « components/safe_browsing_db/v4_store.cc ('k') | components/search_engines/template_url_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698