| 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 #ifndef CHROME_BROWSER_WEBDATA_AUTOCOMPLETE_SYNCABLE_SERVICE_H_ | 4 #ifndef CHROME_BROWSER_WEBDATA_AUTOCOMPLETE_SYNCABLE_SERVICE_H_ |
| 5 #define CHROME_BROWSER_WEBDATA_AUTOCOMPLETE_SYNCABLE_SERVICE_H_ | 5 #define CHROME_BROWSER_WEBDATA_AUTOCOMPLETE_SYNCABLE_SERVICE_H_ |
| 6 #pragma once | 6 #pragma once |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // TODO(georgey) : remove reliance on the notifications and make it to be called | 41 // TODO(georgey) : remove reliance on the notifications and make it to be called |
| 42 // from web_data_service directly. | 42 // from web_data_service directly. |
| 43 class AutocompleteSyncableService | 43 class AutocompleteSyncableService |
| 44 : public syncer::SyncableService, | 44 : public syncer::SyncableService, |
| 45 public content::NotificationObserver, | 45 public content::NotificationObserver, |
| 46 public base::NonThreadSafe { | 46 public base::NonThreadSafe { |
| 47 public: | 47 public: |
| 48 explicit AutocompleteSyncableService(WebDataService* web_data_service); | 48 explicit AutocompleteSyncableService(WebDataService* web_data_service); |
| 49 virtual ~AutocompleteSyncableService(); | 49 virtual ~AutocompleteSyncableService(); |
| 50 | 50 |
| 51 static syncable::ModelType model_type() { return syncable::AUTOFILL; } | 51 static syncer::ModelType model_type() { return syncer::AUTOFILL; } |
| 52 | 52 |
| 53 // syncer::SyncableService implementation. | 53 // syncer::SyncableService implementation. |
| 54 virtual syncer::SyncError MergeDataAndStartSyncing( | 54 virtual syncer::SyncError MergeDataAndStartSyncing( |
| 55 syncable::ModelType type, | 55 syncer::ModelType type, |
| 56 const syncer::SyncDataList& initial_sync_data, | 56 const syncer::SyncDataList& initial_sync_data, |
| 57 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, | 57 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, |
| 58 scoped_ptr<syncer::SyncErrorFactory> error_handler) OVERRIDE; | 58 scoped_ptr<syncer::SyncErrorFactory> error_handler) OVERRIDE; |
| 59 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; | 59 virtual void StopSyncing(syncer::ModelType type) OVERRIDE; |
| 60 virtual syncer::SyncDataList GetAllSyncData( | 60 virtual syncer::SyncDataList GetAllSyncData( |
| 61 syncable::ModelType type) const OVERRIDE; | 61 syncer::ModelType type) const OVERRIDE; |
| 62 virtual syncer::SyncError ProcessSyncChanges( | 62 virtual syncer::SyncError ProcessSyncChanges( |
| 63 const tracked_objects::Location& from_here, | 63 const tracked_objects::Location& from_here, |
| 64 const syncer::SyncChangeList& change_list) OVERRIDE; | 64 const syncer::SyncChangeList& change_list) OVERRIDE; |
| 65 | 65 |
| 66 // NotificationObserver implementation. | 66 // NotificationObserver implementation. |
| 67 virtual void Observe(int type, | 67 virtual void Observe(int type, |
| 68 const content::NotificationSource& source, | 68 const content::NotificationSource& source, |
| 69 const content::NotificationDetails& details) OVERRIDE; | 69 const content::NotificationDetails& details) OVERRIDE; |
| 70 | 70 |
| 71 protected: | 71 protected: |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; | 141 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; |
| 142 | 142 |
| 143 // We receive ownership of |error_handler_| in MergeDataAndStartSyncing() and | 143 // We receive ownership of |error_handler_| in MergeDataAndStartSyncing() and |
| 144 // destroy it in StopSyncing(). | 144 // destroy it in StopSyncing(). |
| 145 scoped_ptr<syncer::SyncErrorFactory> error_handler_; | 145 scoped_ptr<syncer::SyncErrorFactory> error_handler_; |
| 146 | 146 |
| 147 DISALLOW_COPY_AND_ASSIGN(AutocompleteSyncableService); | 147 DISALLOW_COPY_AND_ASSIGN(AutocompleteSyncableService); |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 #endif // CHROME_BROWSER_WEBDATA_AUTOCOMPLETE_SYNCABLE_SERVICE_H_ | 150 #endif // CHROME_BROWSER_WEBDATA_AUTOCOMPLETE_SYNCABLE_SERVICE_H_ |
| OLD | NEW |