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

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

Issue 2030833003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //components (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 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_pref_test_util.h" 5 #include "components/search_engines/default_search_pref_test_util.h"
6 6
7 #include "base/strings/string_split.h" 7 #include "base/strings/string_split.h"
8 #include "components/search_engines/default_search_manager.h" 8 #include "components/search_engines/default_search_manager.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 new base::StringValue(search_terms_replacement_key)); 42 new base::StringValue(search_terms_replacement_key));
43 43
44 std::unique_ptr<base::ListValue> encodings_list(new base::ListValue); 44 std::unique_ptr<base::ListValue> encodings_list(new base::ListValue);
45 for (const std::string& term : base::SplitString( 45 for (const std::string& term : base::SplitString(
46 encodings, ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) 46 encodings, ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL))
47 encodings_list->AppendString(term); 47 encodings_list->AppendString(term);
48 value->Set(DefaultSearchManager::kInputEncodings, encodings_list.release()); 48 value->Set(DefaultSearchManager::kInputEncodings, encodings_list.release());
49 49
50 std::unique_ptr<base::ListValue> alternate_url_list(new base::ListValue()); 50 std::unique_ptr<base::ListValue> alternate_url_list(new base::ListValue());
51 if (!alternate_url.empty()) 51 if (!alternate_url.empty())
52 alternate_url_list->Append(new base::StringValue(alternate_url)); 52 alternate_url_list->AppendString(alternate_url);
53 value->Set(DefaultSearchManager::kAlternateURLs, 53 value->Set(DefaultSearchManager::kAlternateURLs,
54 alternate_url_list.release()); 54 alternate_url_list.release());
55 return value; 55 return value;
56 } 56 }
OLDNEW
« no previous file with comments | « components/prefs/pref_service_unittest.cc ('k') | components/ssl_config/ssl_config_service_manager_pref_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698