| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 const std::string& search_url); | 186 const std::string& search_url); |
| 187 | 187 |
| 188 // Return true if the given |url| can be made the default. | 188 // Return true if the given |url| can be made the default. |
| 189 bool CanMakeDefault(const TemplateURL* url); | 189 bool CanMakeDefault(const TemplateURL* url); |
| 190 | 190 |
| 191 // Set the default search provider. |url| may be null. | 191 // Set the default search provider. |url| may be null. |
| 192 // This will assert if the default search is managed; the UI should not be | 192 // This will assert if the default search is managed; the UI should not be |
| 193 // invoking this method in that situation. | 193 // invoking this method in that situation. |
| 194 void SetDefaultSearchProvider(const TemplateURL* url); | 194 void SetDefaultSearchProvider(const TemplateURL* url); |
| 195 | 195 |
| 196 // Forces saving the default search provider in the database so that the |
| 197 // backup and its signature are persisted in the db. |url| may be null. |
| 198 // This will assert if the default search is managed; the UI should not be |
| 199 // invoking this method in that situation. |
| 200 void ForceSetDefaultSearchProvider(const TemplateURL* url); |
| 201 |
| 196 // Returns the default search provider. If the TemplateURLService hasn't been | 202 // Returns the default search provider. If the TemplateURLService hasn't been |
| 197 // loaded, the default search provider is pulled from preferences. | 203 // loaded, the default search provider is pulled from preferences. |
| 198 // | 204 // |
| 199 // NOTE: At least in unittest mode, this may return NULL. | 205 // NOTE: At least in unittest mode, this may return NULL. |
| 200 const TemplateURL* GetDefaultSearchProvider(); | 206 const TemplateURL* GetDefaultSearchProvider(); |
| 201 | 207 |
| 202 // Returns true if the default search is managed through group policy. | 208 // Returns true if the default search is managed through group policy. |
| 203 bool is_default_search_managed() const { return is_default_search_managed_; } | 209 bool is_default_search_managed() const { return is_default_search_managed_; } |
| 204 | 210 |
| 205 // Observers used to listen for changes to the model. | 211 // Observers used to listen for changes to the model. |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 // true, we ignore any local search engine changes, since we triggered them. | 576 // true, we ignore any local search engine changes, since we triggered them. |
| 571 bool processing_syncer_changes_; | 577 bool processing_syncer_changes_; |
| 572 | 578 |
| 573 // Sync's SyncChange handler. We push all our changes through this. | 579 // Sync's SyncChange handler. We push all our changes through this. |
| 574 SyncChangeProcessor* sync_processor_; | 580 SyncChangeProcessor* sync_processor_; |
| 575 | 581 |
| 576 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); | 582 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); |
| 577 }; | 583 }; |
| 578 | 584 |
| 579 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 585 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| OLD | NEW |