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 | 10 |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 // we have an encrypted data type enabled. | 375 // we have an encrypted data type enabled. |
376 virtual bool IsPassphraseRequiredForDecryption() const; | 376 virtual bool IsPassphraseRequiredForDecryption() const; |
377 | 377 |
378 syncer::PassphraseRequiredReason passphrase_required_reason() const { | 378 syncer::PassphraseRequiredReason passphrase_required_reason() const { |
379 return passphrase_required_reason_; | 379 return passphrase_required_reason_; |
380 } | 380 } |
381 | 381 |
382 // Returns a user-friendly string form of last synced time (in minutes). | 382 // Returns a user-friendly string form of last synced time (in minutes). |
383 virtual string16 GetLastSyncedTimeString() const; | 383 virtual string16 GetLastSyncedTimeString() const; |
384 | 384 |
| 385 // Returns a human readable string describing backend initialization state. |
| 386 std::string GetBackendInitializationStateString() const; |
| 387 |
385 // Returns true if startup is suppressed (i.e. user has stopped syncing via | 388 // Returns true if startup is suppressed (i.e. user has stopped syncing via |
386 // the google dashboard). | 389 // the google dashboard). |
387 virtual bool IsStartSuppressed() const; | 390 virtual bool IsStartSuppressed() const; |
388 | 391 |
389 ProfileSyncComponentsFactory* factory() { return factory_.get(); } | 392 ProfileSyncComponentsFactory* factory() { return factory_.get(); } |
390 | 393 |
391 // The profile we are syncing for. | 394 // The profile we are syncing for. |
392 Profile* profile() const { return profile_; } | 395 Profile* profile() const { return profile_; } |
393 | 396 |
394 // Returns a weak pointer to the service's JsController. | 397 // Returns a weak pointer to the service's JsController. |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 const invalidation::ObjectId& id, | 613 const invalidation::ObjectId& id, |
611 const std::string& payload); | 614 const std::string& payload); |
612 | 615 |
613 protected: | 616 protected: |
614 // Used by test classes that derive from ProfileSyncService. | 617 // Used by test classes that derive from ProfileSyncService. |
615 virtual browser_sync::SyncBackendHost* GetBackendForTest(); | 618 virtual browser_sync::SyncBackendHost* GetBackendForTest(); |
616 | 619 |
617 // Helper to install and configure a data type manager. | 620 // Helper to install and configure a data type manager. |
618 void ConfigureDataTypeManager(); | 621 void ConfigureDataTypeManager(); |
619 | 622 |
620 // Starts up the backend sync components. | |
621 virtual void StartUp(); | |
622 // Shuts down the backend sync components. | 623 // Shuts down the backend sync components. |
623 // |sync_disabled| indicates if syncing is being disabled or not. | 624 // |sync_disabled| indicates if syncing is being disabled or not. |
624 void ShutdownImpl(bool sync_disabled); | 625 void ShutdownImpl(bool sync_disabled); |
625 | 626 |
626 // Return SyncCredentials from the TokenService. | 627 // Return SyncCredentials from the TokenService. |
627 syncer::SyncCredentials GetCredentials(); | 628 syncer::SyncCredentials GetCredentials(); |
628 | 629 |
629 // Test need to override this to create backends that allow setting up | 630 // Test need to override this to create backends that allow setting up |
630 // initial conditions, such as populating sync nodes. | 631 // initial conditions, such as populating sync nodes. |
631 // | 632 // |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 | 712 |
712 // Sets the last synced time to the current time. | 713 // Sets the last synced time to the current time. |
713 void UpdateLastSyncedTime(); | 714 void UpdateLastSyncedTime(); |
714 | 715 |
715 void NotifyObservers(); | 716 void NotifyObservers(); |
716 | 717 |
717 void ClearStaleErrors(); | 718 void ClearStaleErrors(); |
718 | 719 |
719 void ClearUnrecoverableError(); | 720 void ClearUnrecoverableError(); |
720 | 721 |
| 722 enum StartUpDeferredOption { |
| 723 STARTUP_BACKEND_DEFERRED, |
| 724 STARTUP_IMMEDIATE |
| 725 }; |
| 726 void StartUp(StartUpDeferredOption deferred_option); |
| 727 |
| 728 // Starts up the backend sync components. |deferred_option| specifies whether |
| 729 // this is being called as part of an immediate startup or startup was |
| 730 // originally deferred and we're finally getting around to finishing. |
| 731 void StartUpSlowBackendComponents(StartUpDeferredOption deferred_option); |
| 732 |
721 // About-flags experiment names for datatypes that aren't enabled by default | 733 // About-flags experiment names for datatypes that aren't enabled by default |
722 // yet. | 734 // yet. |
723 static std::string GetExperimentNameForDataType( | 735 static std::string GetExperimentNameForDataType( |
724 syncer::ModelType data_type); | 736 syncer::ModelType data_type); |
725 | 737 |
726 // Create and register a new datatype controller. | 738 // Create and register a new datatype controller. |
727 void RegisterNewDataType(syncer::ModelType data_type); | 739 void RegisterNewDataType(syncer::ModelType data_type); |
728 | 740 |
729 // Helper method to process SyncConfigureDone after unwinding the stack that | 741 // Helper method to process SyncConfigureDone after unwinding the stack that |
730 // originally posted this SyncConfigureDone. | 742 // originally posted this SyncConfigureDone. |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; | 918 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; |
907 | 919 |
908 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 920 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
909 }; | 921 }; |
910 | 922 |
911 bool ShouldShowActionOnUI( | 923 bool ShouldShowActionOnUI( |
912 const syncer::SyncProtocolError& error); | 924 const syncer::SyncProtocolError& error); |
913 | 925 |
914 | 926 |
915 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 927 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
OLD | NEW |