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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 // updated or removed. | 266 // updated or removed. |
267 virtual SyncError ProcessSyncChanges( | 267 virtual SyncError ProcessSyncChanges( |
268 const tracked_objects::Location& from_here, | 268 const tracked_objects::Location& from_here, |
269 const SyncChangeList& change_list) OVERRIDE; | 269 const SyncChangeList& change_list) OVERRIDE; |
270 // Merge initial search engine data from Sync and push any local changes up | 270 // Merge initial search engine data from Sync and push any local changes up |
271 // to Sync. This may send notifications if local search engines are added, | 271 // to Sync. This may send notifications if local search engines are added, |
272 // updated or removed. | 272 // updated or removed. |
273 virtual SyncError MergeDataAndStartSyncing( | 273 virtual SyncError MergeDataAndStartSyncing( |
274 syncable::ModelType type, | 274 syncable::ModelType type, |
275 const SyncDataList& initial_sync_data, | 275 const SyncDataList& initial_sync_data, |
276 SyncChangeProcessor* sync_processor) OVERRIDE; | 276 scoped_ptr<SyncChangeProcessor> sync_processor) OVERRIDE; |
277 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; | 277 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; |
278 | 278 |
279 // Processes a local TemplateURL change for Sync. |turl| is the TemplateURL | 279 // Processes a local TemplateURL change for Sync. |turl| is the TemplateURL |
280 // that has been modified, and |type| is the Sync ChangeType that took place. | 280 // that has been modified, and |type| is the Sync ChangeType that took place. |
281 // This may send a new SyncChange to the cloud. If our model has not yet been | 281 // This may send a new SyncChange to the cloud. If our model has not yet been |
282 // associated with Sync, or if this is triggered by a Sync change, then this | 282 // associated with Sync, or if this is triggered by a Sync change, then this |
283 // does nothing. | 283 // does nothing. |
284 void ProcessTemplateURLChange(const TemplateURL* turl, | 284 void ProcessTemplateURLChange(const TemplateURL* turl, |
285 SyncChange::SyncChangeType type); | 285 SyncChange::SyncChangeType type); |
286 | 286 |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 // Set in MergeDataAndStartSyncing, reset in StopSyncing. While this is not | 577 // Set in MergeDataAndStartSyncing, reset in StopSyncing. While this is not |
578 // set, we ignore any local search engine changes (when we start syncing we | 578 // set, we ignore any local search engine changes (when we start syncing we |
579 // will look up the most recent values anyways). | 579 // will look up the most recent values anyways). |
580 bool models_associated_; | 580 bool models_associated_; |
581 | 581 |
582 // Whether we're currently processing changes from the syncer. While this is | 582 // Whether we're currently processing changes from the syncer. While this is |
583 // true, we ignore any local search engine changes, since we triggered them. | 583 // true, we ignore any local search engine changes, since we triggered them. |
584 bool processing_syncer_changes_; | 584 bool processing_syncer_changes_; |
585 | 585 |
586 // Sync's SyncChange handler. We push all our changes through this. | 586 // Sync's SyncChange handler. We push all our changes through this. |
587 SyncChangeProcessor* sync_processor_; | 587 scoped_ptr<SyncChangeProcessor> sync_processor_; |
588 | 588 |
589 // Whether or not we are waiting on the default search provider to come in | 589 // Whether or not we are waiting on the default search provider to come in |
590 // from Sync. This is to facilitate the fact that changes to the value of | 590 // from Sync. This is to facilitate the fact that changes to the value of |
591 // prefs::kSyncedDefaultSearchProviderGUID do not always come before the | 591 // prefs::kSyncedDefaultSearchProviderGUID do not always come before the |
592 // TemplateURL entry it refers to, and to handle the case when we want to use | 592 // TemplateURL entry it refers to, and to handle the case when we want to use |
593 // the Synced default when the default search provider becomes unmanaged. | 593 // the Synced default when the default search provider becomes unmanaged. |
594 bool pending_synced_default_search_; | 594 bool pending_synced_default_search_; |
595 | 595 |
596 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); | 596 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); |
597 }; | 597 }; |
598 | 598 |
599 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 599 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
OLD | NEW |