| 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_TEMPLATE_URL_SERVICE_H_ | 5 #ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| 6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 | 251 |
| 252 // Set the default search provider. |url| may be null. | 252 // Set the default search provider. |url| may be null. |
| 253 // This will assert if the default search is managed; the UI should not be | 253 // This will assert if the default search is managed; the UI should not be |
| 254 // invoking this method in that situation. | 254 // invoking this method in that situation. |
| 255 void SetUserSelectedDefaultSearchProvider(TemplateURL* url); | 255 void SetUserSelectedDefaultSearchProvider(TemplateURL* url); |
| 256 | 256 |
| 257 // Returns the default search provider. If the TemplateURLService hasn't been | 257 // Returns the default search provider. If the TemplateURLService hasn't been |
| 258 // loaded, the default search provider is pulled from preferences. | 258 // loaded, the default search provider is pulled from preferences. |
| 259 // | 259 // |
| 260 // NOTE: At least in unittest mode, this may return NULL. | 260 // NOTE: At least in unittest mode, this may return NULL. |
| 261 // TODO(blundell): See if all callers can be converted to take in const | |
| 262 // pointers and eliminate this version of the method. | |
| 263 TemplateURL* GetDefaultSearchProvider(); | |
| 264 const TemplateURL* GetDefaultSearchProvider() const; | 261 const TemplateURL* GetDefaultSearchProvider() const; |
| 265 | 262 |
| 266 // Returns true if the |url| is a search results page from the default search | 263 // Returns true if the |url| is a search results page from the default search |
| 267 // provider. | 264 // provider. |
| 268 bool IsSearchResultsPageFromDefaultSearchProvider(const GURL& url) const; | 265 bool IsSearchResultsPageFromDefaultSearchProvider(const GURL& url) const; |
| 269 | 266 |
| 270 // Returns true if the default search is managed through group policy. | 267 // Returns true if the default search is managed through group policy. |
| 271 bool is_default_search_managed() const { | 268 bool is_default_search_managed() const { |
| 272 return default_search_provider_source_ == DefaultSearchManager::FROM_POLICY; | 269 return default_search_provider_source_ == DefaultSearchManager::FROM_POLICY; |
| 273 } | 270 } |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 // Helper class to manage the default search engine. | 845 // Helper class to manage the default search engine. |
| 849 DefaultSearchManager default_search_manager_; | 846 DefaultSearchManager default_search_manager_; |
| 850 | 847 |
| 851 std::unique_ptr<GoogleURLTracker::Subscription> | 848 std::unique_ptr<GoogleURLTracker::Subscription> |
| 852 google_url_updated_subscription_; | 849 google_url_updated_subscription_; |
| 853 | 850 |
| 854 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); | 851 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); |
| 855 }; | 852 }; |
| 856 | 853 |
| 857 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 854 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| OLD | NEW |