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

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

Issue 9295044: Start moving signin code out of browser/sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback Created 8 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 #pragma once 7 #pragma once
8 8
9 #include <list> 9 #include <list>
10 #include <string> 10 #include <string>
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 // takes place, and the backend isn't initialized yet? 312 // takes place, and the backend isn't initialized yet?
313 virtual bool sync_initialized() const; 313 virtual bool sync_initialized() const;
314 virtual bool unrecoverable_error_detected() const; 314 virtual bool unrecoverable_error_detected() const;
315 const std::string& unrecoverable_error_message() { 315 const std::string& unrecoverable_error_message() {
316 return unrecoverable_error_message_; 316 return unrecoverable_error_message_;
317 } 317 }
318 tracked_objects::Location unrecoverable_error_location() { 318 tracked_objects::Location unrecoverable_error_location() {
319 return unrecoverable_error_location_; 319 return unrecoverable_error_location_;
320 } 320 }
321 321
322 // Tracks whether the user is currently authenticating or not. This is used 322 // Reports whether the user is currently authenticating or not. This is used
323 // by the sync_ui_util helper routines to allow the UI to properly display 323 // by the sync_ui_util helper routines to allow the UI to properly display
324 // an "authenticating..." status message instead of an auth error when we are 324 // an "authenticating..." status message instead of an auth error when we are
325 // in the process of trying to update credentials. 325 // in the process of trying to update credentials.
326 // TODO(atwilson): This state should reside up in the UI or in a profile- 326 // TODO(atwilson): This state should reside up in the UI or in a profile-
327 // specific SyncUIUtil object rather than in ProfileSyncService. 327 // specific SyncUIUtil object rather than in ProfileSyncService.
328 virtual bool UIShouldDepictAuthInProgress() const; 328 virtual bool UIShouldDepictAuthInProgress() const;
tim (not reviewing) 2012/02/14 02:11:21 do we still need this if we now have AuthInProgres
Andrew T Wilson (Slow) 2012/02/14 05:23:52 Done, updated todo.
329 virtual void SetUIShouldDepictAuthInProgress(bool auth_in_progress);
330 329
331 // Returns true if OnPassphraseRequired has been called for any reason. 330 // Returns true if OnPassphraseRequired has been called for any reason.
332 virtual bool IsPassphraseRequired() const; 331 virtual bool IsPassphraseRequired() const;
333 332
334 // Returns true if OnPassphraseRequired has been called for decryption and 333 // Returns true if OnPassphraseRequired has been called for decryption and
335 // we have an encrypted data type enabled. 334 // we have an encrypted data type enabled.
336 virtual bool IsPassphraseRequiredForDecryption() const; 335 virtual bool IsPassphraseRequiredForDecryption() const;
337 336
338 sync_api::PassphraseRequiredReason passphrase_required_reason() const { 337 sync_api::PassphraseRequiredReason passphrase_required_reason() const {
339 return passphrase_required_reason_; 338 return passphrase_required_reason_;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 void AcknowledgeSyncedTypes(); 507 void AcknowledgeSyncedTypes();
509 508
510 SyncGlobalError* sync_global_error() { return sync_global_error_.get(); } 509 SyncGlobalError* sync_global_error() { return sync_global_error_.get(); }
511 510
512 virtual const FailedDatatypesHandler& failed_datatypes_handler(); 511 virtual const FailedDatatypesHandler& failed_datatypes_handler();
513 512
514 browser_sync::DataTypeManager::ConfigureStatus configure_status() { 513 browser_sync::DataTypeManager::ConfigureStatus configure_status() {
515 return configure_status_; 514 return configure_status_;
516 } 515 }
517 516
517 bool waiting_for_auth() const { return is_auth_in_progress_; }
tim (not reviewing) 2012/02/14 02:11:21 why do we need this?
Andrew T Wilson (Slow) 2012/02/14 05:23:52 Now that ProfileSyncService isn't explicitly drivi
518
518 // ProfileKeyedService implementation. 519 // ProfileKeyedService implementation.
519 virtual void Shutdown() OVERRIDE; 520 virtual void Shutdown() OVERRIDE;
520 521
521 protected: 522 protected:
522 // Used by test classes that derive from ProfileSyncService. 523 // Used by test classes that derive from ProfileSyncService.
523 virtual browser_sync::SyncBackendHost* GetBackendForTest(); 524 virtual browser_sync::SyncBackendHost* GetBackendForTest();
524 525
525 // Helper to install and configure a data type manager. 526 // Helper to install and configure a data type manager.
526 void ConfigureDataTypeManager(); 527 void ConfigureDataTypeManager();
527 528
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 browser_sync::DataTypeManager::ConfigureResult result); 608 browser_sync::DataTypeManager::ConfigureResult result);
608 609
609 // Reconfigures the data type manager with the latest enabled types. 610 // Reconfigures the data type manager with the latest enabled types.
610 // Note: Does not initialize the backend if it is not already initialized. 611 // Note: Does not initialize the backend if it is not already initialized.
611 // This function needs to be called only after sync has been initialized 612 // This function needs to be called only after sync has been initialized
612 // (i.e.,only for reconfigurations). The reason we don't initialize the 613 // (i.e.,only for reconfigurations). The reason we don't initialize the
613 // backend is because if we had encountered an unrecoverable error we dont 614 // backend is because if we had encountered an unrecoverable error we dont
614 // want to startup once more. 615 // want to startup once more.
615 virtual void ReconfigureDatatypeManager(); 616 virtual void ReconfigureDatatypeManager();
616 617
617
618 // Time at which we begin an attempt a GAIA authorization.
619 base::TimeTicks auth_start_time_;
620
621 // Time at which error UI is presented for the new tab page.
622 base::TimeTicks auth_error_time_;
623
624 // Factory used to create various dependent objects. 618 // Factory used to create various dependent objects.
625 scoped_ptr<ProfileSyncComponentsFactory> factory_; 619 scoped_ptr<ProfileSyncComponentsFactory> factory_;
626 620
627 // The profile whose data we are synchronizing. 621 // The profile whose data we are synchronizing.
628 Profile* profile_; 622 Profile* profile_;
629 623
630 // The class that handles getting, setting, and persisting sync 624 // The class that handles getting, setting, and persisting sync
631 // preferences. 625 // preferences.
632 browser_sync::SyncPrefs sync_prefs_; 626 browser_sync::SyncPrefs sync_prefs_;
633 627
634 // TODO(ncarter): Put this in a profile, once there is UI for it. 628 // TODO(ncarter): Put this in a profile, once there is UI for it.
635 // This specifies where to find the sync server. 629 // This specifies where to find the sync server.
636 GURL sync_service_url_; 630 GURL sync_service_url_;
637 631
638 // The last time we detected a successful transition from SYNCING state. 632 // The last time we detected a successful transition from SYNCING state.
639 // Our backend notifies us whenever we should take a new snapshot. 633 // Our backend notifies us whenever we should take a new snapshot.
640 base::Time last_synced_time_; 634 base::Time last_synced_time_;
641 635
642 // List of available data type controllers. 636 // List of available data type controllers.
643 browser_sync::DataTypeController::TypeMap data_type_controllers_; 637 browser_sync::DataTypeController::TypeMap data_type_controllers_;
644 638
645 // Whether the SyncBackendHost has been initialized. 639 // Whether the SyncBackendHost has been initialized.
646 bool backend_initialized_; 640 bool backend_initialized_;
647 641
648 // Various pieces of UI query this value to determine if they should show 642 // Set to true if a signin has completed but we're still waiting for the
649 // an "Authenticating.." type of message. We are the only central place 643 // backend to refresh its credentials.
650 // all auth attempts funnel through, so it makes sense to provide this.
651 // As its name suggests, this should NOT be used for anything other than UI.
652 bool is_auth_in_progress_; 644 bool is_auth_in_progress_;
653 645
654 SyncSetupWizard wizard_; 646 SyncSetupWizard wizard_;
655 647
656 // Encapsulates user signin - used to set/get the user's authenticated 648 // Encapsulates user signin - used to set/get the user's authenticated
657 // email address. 649 // email address.
658 SigninManager* signin_; 650 SigninManager* signin_;
659 651
660 // True if an unrecoverable error (e.g. violation of an assumed invariant) 652 // True if an unrecoverable error (e.g. violation of an assumed invariant)
661 // occurred during syncer operation. This value should be checked before 653 // occurred during syncer operation. This value should be checked before
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 browser_sync::DataTypeManager::ConfigureStatus configure_status_; 733 browser_sync::DataTypeManager::ConfigureStatus configure_status_;
742 734
743 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 735 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
744 }; 736 };
745 737
746 bool ShouldShowActionOnUI( 738 bool ShouldShowActionOnUI(
747 const browser_sync::SyncProtocolError& error); 739 const browser_sync::SyncProtocolError& error);
748 740
749 741
750 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 742 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698