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_MANAGER_H_ | 5 #ifndef COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_ |
6 #define COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_ | 6 #define COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 static const char kLastModified[]; | 56 static const char kLastModified[]; |
57 static const char kLastVisited[]; | 57 static const char kLastVisited[]; |
58 | 58 |
59 static const char kUsageCount[]; | 59 static const char kUsageCount[]; |
60 static const char kAlternateURLs[]; | 60 static const char kAlternateURLs[]; |
61 static const char kSearchTermsReplacementKey[]; | 61 static const char kSearchTermsReplacementKey[]; |
62 static const char kCreatedByPolicy[]; | 62 static const char kCreatedByPolicy[]; |
63 static const char kDisabledByPolicy[]; | 63 static const char kDisabledByPolicy[]; |
64 | 64 |
65 enum Source { | 65 enum Source { |
| 66 // Default search engine chosen either from prepopulated engines set for |
| 67 // current country or overriden from kSearchProviderOverrides preference. |
66 FROM_FALLBACK = 0, | 68 FROM_FALLBACK = 0, |
| 69 // User selected engine. |
67 FROM_USER, | 70 FROM_USER, |
| 71 // Search engine set by extension overriding default search. |
68 FROM_EXTENSION, | 72 FROM_EXTENSION, |
| 73 // Search engine controlled externally through enterprise configuration |
| 74 // management (e.g. windows group policy). |
69 FROM_POLICY, | 75 FROM_POLICY, |
70 }; | 76 }; |
71 | 77 |
72 typedef base::Callback<void(const TemplateURLData*, Source)> ObserverCallback; | 78 typedef base::Callback<void(const TemplateURLData*, Source)> ObserverCallback; |
73 | 79 |
74 DefaultSearchManager(PrefService* pref_service, | 80 DefaultSearchManager(PrefService* pref_service, |
75 const ObserverCallback& change_observer); | 81 const ObserverCallback& change_observer); |
76 | 82 |
77 ~DefaultSearchManager(); | 83 ~DefaultSearchManager(); |
78 | 84 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // prefs). This will be null if no value was set in the pref store. | 164 // prefs). This will be null if no value was set in the pref store. |
159 std::unique_ptr<TemplateURLData> prefs_default_search_; | 165 std::unique_ptr<TemplateURLData> prefs_default_search_; |
160 | 166 |
161 // True if the default search is currently enforced by policy. | 167 // True if the default search is currently enforced by policy. |
162 bool default_search_controlled_by_policy_; | 168 bool default_search_controlled_by_policy_; |
163 | 169 |
164 DISALLOW_COPY_AND_ASSIGN(DefaultSearchManager); | 170 DISALLOW_COPY_AND_ASSIGN(DefaultSearchManager); |
165 }; | 171 }; |
166 | 172 |
167 #endif // COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_ | 173 #endif // COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_ |
OLD | NEW |