Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: chrome/browser/sync/profile_sync_service.h

Issue 12288010: sync: preliminary support for deferred SyncBackendHost initialization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 // Returns true if OnPassphraseRequired has been called for decryption and 374 // Returns true if OnPassphraseRequired has been called for decryption and
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 std::string GetBackendInitializationStateString() const;
Nicolas Zea 2013/02/19 19:01:06 Newline above this and add comment about what this
tim (not reviewing) 2013/02/21 03:50:54 Done.
384 385
385 // Returns true if startup is suppressed (i.e. user has stopped syncing via 386 // Returns true if startup is suppressed (i.e. user has stopped syncing via
386 // the google dashboard). 387 // the google dashboard).
387 virtual bool IsStartSuppressed() const; 388 virtual bool IsStartSuppressed() const;
388 389
389 ProfileSyncComponentsFactory* factory() { return factory_.get(); } 390 ProfileSyncComponentsFactory* factory() { return factory_.get(); }
390 391
391 // The profile we are syncing for. 392 // The profile we are syncing for.
392 Profile* profile() const { return profile_; } 393 Profile* profile() const { return profile_; }
393 394
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 const invalidation::ObjectId& id, 611 const invalidation::ObjectId& id,
611 const std::string& payload); 612 const std::string& payload);
612 613
613 protected: 614 protected:
614 // Used by test classes that derive from ProfileSyncService. 615 // Used by test classes that derive from ProfileSyncService.
615 virtual browser_sync::SyncBackendHost* GetBackendForTest(); 616 virtual browser_sync::SyncBackendHost* GetBackendForTest();
616 617
617 // Helper to install and configure a data type manager. 618 // Helper to install and configure a data type manager.
618 void ConfigureDataTypeManager(); 619 void ConfigureDataTypeManager();
619 620
620 // Starts up the backend sync components.
621 virtual void StartUp();
622 // Shuts down the backend sync components. 621 // Shuts down the backend sync components.
623 // |sync_disabled| indicates if syncing is being disabled or not. 622 // |sync_disabled| indicates if syncing is being disabled or not.
624 void ShutdownImpl(bool sync_disabled); 623 void ShutdownImpl(bool sync_disabled);
625 624
626 // Return SyncCredentials from the TokenService. 625 // Return SyncCredentials from the TokenService.
627 syncer::SyncCredentials GetCredentials(); 626 syncer::SyncCredentials GetCredentials();
628 627
629 // Test need to override this to create backends that allow setting up 628 // Test need to override this to create backends that allow setting up
630 // initial conditions, such as populating sync nodes. 629 // initial conditions, such as populating sync nodes.
631 // 630 //
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 710
712 // Sets the last synced time to the current time. 711 // Sets the last synced time to the current time.
713 void UpdateLastSyncedTime(); 712 void UpdateLastSyncedTime();
714 713
715 void NotifyObservers(); 714 void NotifyObservers();
716 715
717 void ClearStaleErrors(); 716 void ClearStaleErrors();
718 717
719 void ClearUnrecoverableError(); 718 void ClearUnrecoverableError();
720 719
720 enum StartUpDeferred {
Nicolas Zea 2013/02/19 19:01:06 nit: StartUpPolicy seems like a better name for th
tim (not reviewing) 2013/02/21 03:50:54 Went with StartUpDeferredOption, because 'start up
721 STARTUP_DEFER_BACKEND,
722 STARTUP_IMMEDIATE
723 };
724 void StartUp(StartUpDeferred deferred);
725
726 // Starts up the backend sync components.
727 void StartUpSlowBackendComponents();
728
721 // About-flags experiment names for datatypes that aren't enabled by default 729 // About-flags experiment names for datatypes that aren't enabled by default
722 // yet. 730 // yet.
723 static std::string GetExperimentNameForDataType( 731 static std::string GetExperimentNameForDataType(
724 syncer::ModelType data_type); 732 syncer::ModelType data_type);
725 733
726 // Create and register a new datatype controller. 734 // Create and register a new datatype controller.
727 void RegisterNewDataType(syncer::ModelType data_type); 735 void RegisterNewDataType(syncer::ModelType data_type);
728 736
729 // Helper method to process SyncConfigureDone after unwinding the stack that 737 // Helper method to process SyncConfigureDone after unwinding the stack that
730 // originally posted this SyncConfigureDone. 738 // originally posted this SyncConfigureDone.
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; 914 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_;
907 915
908 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 916 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
909 }; 917 };
910 918
911 bool ShouldShowActionOnUI( 919 bool ShouldShowActionOnUI(
912 const syncer::SyncProtocolError& error); 920 const syncer::SyncProtocolError& error);
913 921
914 922
915 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 923 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698