| 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_SYNC_PROFILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // tell the sync engine that setup is completed and it can begin downloading | 154 // tell the sync engine that setup is completed and it can begin downloading |
| 155 // data from the sync server. | 155 // data from the sync server. |
| 156 // | 156 // |
| 157 class ProfileSyncService : public ProfileSyncServiceBase, | 157 class ProfileSyncService : public ProfileSyncServiceBase, |
| 158 public browser_sync::SyncFrontend, | 158 public browser_sync::SyncFrontend, |
| 159 public browser_sync::SyncPrefObserver, | 159 public browser_sync::SyncPrefObserver, |
| 160 public browser_sync::DataTypeManagerObserver, | 160 public browser_sync::DataTypeManagerObserver, |
| 161 public SigninGlobalError::AuthStatusProvider, | 161 public SigninGlobalError::AuthStatusProvider, |
| 162 public syncer::UnrecoverableErrorHandler, | 162 public syncer::UnrecoverableErrorHandler, |
| 163 public content::NotificationObserver, | 163 public content::NotificationObserver, |
| 164 public ProfileKeyedService, | 164 public BrowserContextKeyedService, |
| 165 public invalidation::InvalidationFrontend { | 165 public invalidation::InvalidationFrontend { |
| 166 public: | 166 public: |
| 167 typedef browser_sync::SyncBackendHost::Status Status; | 167 typedef browser_sync::SyncBackendHost::Status Status; |
| 168 | 168 |
| 169 enum SyncEventCodes { | 169 enum SyncEventCodes { |
| 170 MIN_SYNC_EVENT_CODE = 0, | 170 MIN_SYNC_EVENT_CODE = 0, |
| 171 | 171 |
| 172 // Events starting the sync service. | 172 // Events starting the sync service. |
| 173 START_FROM_NTP = 1, // Sync was started from the ad in NTP | 173 START_FROM_NTP = 1, // Sync was started from the ad in NTP |
| 174 START_FROM_WRENCH = 2, // Sync was started from the Wrench menu. | 174 START_FROM_WRENCH = 2, // Sync was started from the Wrench menu. |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 syncer::InvalidationHandler* handler, | 610 syncer::InvalidationHandler* handler, |
| 611 const syncer::ObjectIdSet& ids) OVERRIDE; | 611 const syncer::ObjectIdSet& ids) OVERRIDE; |
| 612 virtual void UnregisterInvalidationHandler( | 612 virtual void UnregisterInvalidationHandler( |
| 613 syncer::InvalidationHandler* handler) OVERRIDE; | 613 syncer::InvalidationHandler* handler) OVERRIDE; |
| 614 virtual void AcknowledgeInvalidation( | 614 virtual void AcknowledgeInvalidation( |
| 615 const invalidation::ObjectId& id, | 615 const invalidation::ObjectId& id, |
| 616 const syncer::AckHandle& ack_handle) OVERRIDE; | 616 const syncer::AckHandle& ack_handle) OVERRIDE; |
| 617 | 617 |
| 618 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; | 618 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; |
| 619 | 619 |
| 620 // ProfileKeyedService implementation. This must be called exactly | 620 // BrowserContextKeyedService implementation. This must be called exactly |
| 621 // once (before this object is destroyed). | 621 // once (before this object is destroyed). |
| 622 virtual void Shutdown() OVERRIDE; | 622 virtual void Shutdown() OVERRIDE; |
| 623 | 623 |
| 624 // Simulate an incoming notification for the given id and payload. | 624 // Simulate an incoming notification for the given id and payload. |
| 625 void EmitInvalidationForTest( | 625 void EmitInvalidationForTest( |
| 626 const invalidation::ObjectId& id, | 626 const invalidation::ObjectId& id, |
| 627 const std::string& payload); | 627 const std::string& payload); |
| 628 | 628 |
| 629 // Called when a datatype (SyncableService) has a need for sync to start | 629 // Called when a datatype (SyncableService) has a need for sync to start |
| 630 // ASAP, presumably because a local change event has occurred but we're | 630 // ASAP, presumably because a local change event has occurred but we're |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; | 945 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; |
| 946 | 946 |
| 947 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 947 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
| 948 }; | 948 }; |
| 949 | 949 |
| 950 bool ShouldShowActionOnUI( | 950 bool ShouldShowActionOnUI( |
| 951 const syncer::SyncProtocolError& error); | 951 const syncer::SyncProtocolError& error); |
| 952 | 952 |
| 953 | 953 |
| 954 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 954 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |