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 CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_ |
6 #define CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 // Clear the extension-provided default search engine. Does not explicitly | 97 // Clear the extension-provided default search engine. Does not explicitly |
98 // disable Default Search. The new current default search engine will be | 98 // disable Default Search. The new current default search engine will be |
99 // defined by policy, extensions, or pre-populated data. | 99 // defined by policy, extensions, or pre-populated data. |
100 void ClearExtensionControlledDefaultSearchEngine(); | 100 void ClearExtensionControlledDefaultSearchEngine(); |
101 | 101 |
102 // Clear the user's default search provider choice from |pref_service_|. Does | 102 // Clear the user's default search provider choice from |pref_service_|. Does |
103 // not explicitly disable Default Search. The new default search | 103 // not explicitly disable Default Search. The new default search |
104 // engine will be defined by policy, extensions, or pre-populated data. | 104 // engine will be defined by policy, extensions, or pre-populated data. |
105 void ClearUserSelectedDefaultSearchEngine(); | 105 void ClearUserSelectedDefaultSearchEngine(); |
106 | 106 |
107 // Disables the pre-populated TemplateURLs for testing purposes. | |
Peter Kasting
2014/06/18 00:01:04
Nit: This comment doesn't seem very accurate or he
hashimoto
2014/06/18 00:08:38
Done.
| |
108 static void SetFallbackSearchEnginesDisabledForTesting(bool disabled); | |
Peter Kasting
2014/06/18 00:01:04
Nit: I would put this up with the other static met
hashimoto
2014/06/18 00:08:38
Done.
| |
109 | |
107 private: | 110 private: |
108 // Handles changes to kDefaultSearchProviderData pref. This includes sync and | 111 // Handles changes to kDefaultSearchProviderData pref. This includes sync and |
109 // policy changes. Calls LoadDefaultSearchEngineFromPrefs() and | 112 // policy changes. Calls LoadDefaultSearchEngineFromPrefs() and |
110 // NotifyObserver() if the effective DSE might have changed. | 113 // NotifyObserver() if the effective DSE might have changed. |
111 void OnDefaultSearchPrefChanged(); | 114 void OnDefaultSearchPrefChanged(); |
112 | 115 |
113 // Handles changes to kSearchProviderOverrides pref. Calls | 116 // Handles changes to kSearchProviderOverrides pref. Calls |
114 // LoadPrepopulatedDefaultSearch() and NotifyObserver() if the effective DSE | 117 // LoadPrepopulatedDefaultSearch() and NotifyObserver() if the effective DSE |
115 // might have changed. | 118 // might have changed. |
116 void OnOverridesPrefChanged(); | 119 void OnOverridesPrefChanged(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 // default search engines. | 153 // default search engines. |
151 scoped_ptr<TemplateURLData> prefs_default_search_; | 154 scoped_ptr<TemplateURLData> prefs_default_search_; |
152 | 155 |
153 // True if the default search is currently enforced by policy. | 156 // True if the default search is currently enforced by policy. |
154 bool default_search_controlled_by_policy_; | 157 bool default_search_controlled_by_policy_; |
155 | 158 |
156 DISALLOW_COPY_AND_ASSIGN(DefaultSearchManager); | 159 DISALLOW_COPY_AND_ASSIGN(DefaultSearchManager); |
157 }; | 160 }; |
158 | 161 |
159 #endif // CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_ | 162 #endif // CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_ |
OLD | NEW |