| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 bool CanMakeDefault(const TemplateURL* url) const; | 250 bool CanMakeDefault(const TemplateURL* url) const; |
| 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: This may return null in certain circumstances such as: |
| 261 // 1.) Unit test mode |
| 262 // 2.) The default search engine is disabled by policy. |
| 261 const TemplateURL* GetDefaultSearchProvider() const; | 263 const TemplateURL* GetDefaultSearchProvider() const; |
| 262 | 264 |
| 263 // Returns true if the |url| is a search results page from the default search | 265 // Returns true if the |url| is a search results page from the default search |
| 264 // provider. | 266 // provider. |
| 265 bool IsSearchResultsPageFromDefaultSearchProvider(const GURL& url) const; | 267 bool IsSearchResultsPageFromDefaultSearchProvider(const GURL& url) const; |
| 266 | 268 |
| 267 // Returns true if the default search is managed through group policy. | 269 // Returns true if the default search is managed through group policy. |
| 268 bool is_default_search_managed() const { | 270 bool is_default_search_managed() const { |
| 269 return default_search_provider_source_ == DefaultSearchManager::FROM_POLICY; | 271 return default_search_provider_source_ == DefaultSearchManager::FROM_POLICY; |
| 270 } | 272 } |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 // Helper class to manage the default search engine. | 847 // Helper class to manage the default search engine. |
| 846 DefaultSearchManager default_search_manager_; | 848 DefaultSearchManager default_search_manager_; |
| 847 | 849 |
| 848 std::unique_ptr<GoogleURLTracker::Subscription> | 850 std::unique_ptr<GoogleURLTracker::Subscription> |
| 849 google_url_updated_subscription_; | 851 google_url_updated_subscription_; |
| 850 | 852 |
| 851 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); | 853 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); |
| 852 }; | 854 }; |
| 853 | 855 |
| 854 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 856 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| OLD | NEW |