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 #ifndef COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_PREF_TEST_UTIL_H_ | 5 #ifndef COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_PREF_TEST_UTIL_H_ |
6 #define COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_PREF_TEST_UTIL_H_ | 6 #define COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_PREF_TEST_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | |
11 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
12 #include "base/values.h" | 11 #include "base/values.h" |
13 #include "components/search_engines/default_search_manager.h" | 12 #include "components/search_engines/default_search_manager.h" |
14 | 13 |
15 class DefaultSearchPrefTestUtil { | 14 class DefaultSearchPrefTestUtil { |
16 public: | 15 public: |
17 // Creates a DictionaryValue which can be used as a | 16 // Creates a DictionaryValue which can be used as a |
18 // kDefaultSearchProviderDataPrefName preference value. | 17 // kDefaultSearchProviderDataPrefName preference value. |
19 static scoped_ptr<base::DictionaryValue> CreateDefaultSearchPreferenceValue( | 18 static scoped_ptr<base::DictionaryValue> CreateDefaultSearchPreferenceValue( |
20 bool enabled, | 19 bool enabled, |
(...skipping 30 matching lines...) Expand all Loading... |
51 // Remove all the managed preferences for the default search provider and | 50 // Remove all the managed preferences for the default search provider and |
52 // trigger notification. | 51 // trigger notification. |
53 template<typename TestingPrefService> | 52 template<typename TestingPrefService> |
54 static void RemoveManagedPref(TestingPrefService* pref_service) { | 53 static void RemoveManagedPref(TestingPrefService* pref_service) { |
55 pref_service->RemoveManagedPref( | 54 pref_service->RemoveManagedPref( |
56 DefaultSearchManager::kDefaultSearchProviderDataPrefName); | 55 DefaultSearchManager::kDefaultSearchProviderDataPrefName); |
57 } | 56 } |
58 }; | 57 }; |
59 | 58 |
60 #endif // COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_PREF_TEST_UTIL_H_ | 59 #endif // COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_PREF_TEST_UTIL_H_ |
OLD | NEW |