| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TEMPLATE_URL_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 // This will assert if the default search is managed; the UI should not be | 221 // This will assert if the default search is managed; the UI should not be |
| 222 // invoking this method in that situation. | 222 // invoking this method in that situation. |
| 223 void SetDefaultSearchProvider(TemplateURL* url); | 223 void SetDefaultSearchProvider(TemplateURL* url); |
| 224 | 224 |
| 225 // Returns the default search provider. If the TemplateURLService hasn't been | 225 // Returns the default search provider. If the TemplateURLService hasn't been |
| 226 // loaded, the default search provider is pulled from preferences. | 226 // loaded, the default search provider is pulled from preferences. |
| 227 // | 227 // |
| 228 // NOTE: At least in unittest mode, this may return NULL. | 228 // NOTE: At least in unittest mode, this may return NULL. |
| 229 TemplateURL* GetDefaultSearchProvider(); | 229 TemplateURL* GetDefaultSearchProvider(); |
| 230 | 230 |
| 231 // Returns true if the |url| is a search results page from the default search |
| 232 // provider. |
| 233 bool IsSearchResultsPageFromDefaultSearchProvider(const GURL& url); |
| 234 |
| 231 // Returns true if the default search is managed through group policy. | 235 // Returns true if the default search is managed through group policy. |
| 232 bool is_default_search_managed() const { return is_default_search_managed_; } | 236 bool is_default_search_managed() const { return is_default_search_managed_; } |
| 233 | 237 |
| 234 // Returns the default search specified in the prepopulated data, if it | 238 // Returns the default search specified in the prepopulated data, if it |
| 235 // exists. If not, returns first URL in |template_urls_|, or NULL if that's | 239 // exists. If not, returns first URL in |template_urls_|, or NULL if that's |
| 236 // empty. The returned object is owned by TemplateURLService and can be | 240 // empty. The returned object is owned by TemplateURLService and can be |
| 237 // destroyed at any time so should be used right after the call. | 241 // destroyed at any time so should be used right after the call. |
| 238 TemplateURL* FindNewDefaultSearchProvider(); | 242 TemplateURL* FindNewDefaultSearchProvider(); |
| 239 | 243 |
| 240 // Resets the search providers to the prepopulated engines plus any keywords | 244 // Resets the search providers to the prepopulated engines plus any keywords |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 | 715 |
| 712 // This is used to log the origin of changes to the default search provider. | 716 // This is used to log the origin of changes to the default search provider. |
| 713 // We set this value to increasingly specific values when we know what is the | 717 // We set this value to increasingly specific values when we know what is the |
| 714 // cause/origin of a default search change. | 718 // cause/origin of a default search change. |
| 715 DefaultSearchChangeOrigin dsp_change_origin_; | 719 DefaultSearchChangeOrigin dsp_change_origin_; |
| 716 | 720 |
| 717 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); | 721 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); |
| 718 }; | 722 }; |
| 719 | 723 |
| 720 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 724 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| OLD | NEW |