| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |