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

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

Issue 2782553004: Move TestingPrefService to use unique_ptr<Value> (Closed)
Patch Set: comments Created 3 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/search_engines_test_util.h" 5 #include "components/search_engines/search_engines_test_util.h"
6 6
7 #include <utility>
8
7 #include "base/macros.h" 9 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
9 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
10 #include "components/search_engines/default_search_manager.h" 12 #include "components/search_engines/default_search_manager.h"
11 #include "components/search_engines/template_url.h" 13 #include "components/search_engines/template_url.h"
12 #include "components/search_engines/template_url_data.h" 14 #include "components/search_engines/template_url_data.h"
13 #include "components/search_engines/template_url_data_util.h" 15 #include "components/search_engines/template_url_data_util.h"
14 #include "components/sync_preferences/testing_pref_service_syncable.h" 16 #include "components/sync_preferences/testing_pref_service_syncable.h"
15 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
16 18
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 actual->search_terms_replacement_key)); 61 actual->search_terms_replacement_key));
60 } 62 }
61 63
62 void SetExtensionDefaultSearchInPrefs( 64 void SetExtensionDefaultSearchInPrefs(
63 sync_preferences::TestingPrefServiceSyncable* prefs, 65 sync_preferences::TestingPrefServiceSyncable* prefs,
64 const TemplateURLData& data) { 66 const TemplateURLData& data) {
65 std::unique_ptr<base::DictionaryValue> entry = 67 std::unique_ptr<base::DictionaryValue> entry =
66 TemplateURLDataToDictionary(data); 68 TemplateURLDataToDictionary(data);
67 prefs->SetExtensionPref( 69 prefs->SetExtensionPref(
68 DefaultSearchManager::kDefaultSearchProviderDataPrefName, 70 DefaultSearchManager::kDefaultSearchProviderDataPrefName,
69 entry.release()); 71 std::move(entry));
70 } 72 }
71 73
72 void RemoveExtensionDefaultSearchFromPrefs( 74 void RemoveExtensionDefaultSearchFromPrefs(
73 sync_preferences::TestingPrefServiceSyncable* prefs) { 75 sync_preferences::TestingPrefServiceSyncable* prefs) {
74 prefs->RemoveExtensionPref( 76 prefs->RemoveExtensionPref(
75 DefaultSearchManager::kDefaultSearchProviderDataPrefName); 77 DefaultSearchManager::kDefaultSearchProviderDataPrefName);
76 } 78 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698