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

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

Issue 10656033: [sync] Automatic bootstrapping of Sync on Win 8 from cached credentials (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit tests Created 8 years, 5 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 class ChangeProcessor; 49 class ChangeProcessor;
50 class DataTypeManager; 50 class DataTypeManager;
51 class JsController; 51 class JsController;
52 class SessionModelAssociator; 52 class SessionModelAssociator;
53 53
54 namespace sessions { class SyncSessionSnapshot; } 54 namespace sessions { class SyncSessionSnapshot; }
55 } 55 }
56 56
57 namespace syncer { 57 namespace syncer {
58 class BaseTransaction; 58 class BaseTransaction;
59 class CredentialCacheService;
59 struct SyncCredentials; 60 struct SyncCredentials;
60 struct UserShare; 61 struct UserShare;
61 } 62 }
62 63
63 namespace sync_pb { 64 namespace sync_pb {
64 class EncryptedData; 65 class EncryptedData;
65 } // namespace sync_pb 66 } // namespace sync_pb
66 67
67 // ProfileSyncService is the layer between browser subsystems like bookmarks, 68 // ProfileSyncService is the layer between browser subsystems like bookmarks,
68 // and the sync backend. Each subsystem is logically thought of as being 69 // and the sync backend. Each subsystem is logically thought of as being
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 // Returns true if the syncer is waiting for new datatypes to be encrypted. 509 // Returns true if the syncer is waiting for new datatypes to be encrypted.
509 virtual bool encryption_pending() const; 510 virtual bool encryption_pending() const;
510 511
511 // Returns whether processing changes is allowed. Check this before doing 512 // Returns whether processing changes is allowed. Check this before doing
512 // any model-modifying operations. 513 // any model-modifying operations.
513 bool ShouldPushChanges(); 514 bool ShouldPushChanges();
514 515
515 const GURL& sync_service_url() const { return sync_service_url_; } 516 const GURL& sync_service_url() const { return sync_service_url_; }
516 bool auto_start_enabled() const { return auto_start_enabled_; } 517 bool auto_start_enabled() const { return auto_start_enabled_; }
517 SigninManager* signin() const { return signin_; } 518 SigninManager* signin() const { return signin_; }
519 base::WeakPtr<browser_sync::SyncPrefs> sync_prefs() {
520 return sync_prefs_.AsWeakPtr();
Andrew T Wilson (Slow) 2012/07/20 01:04:05 In the past, people who need to access SyncPrefs h
Raghu Simha 2012/07/20 23:35:22 I was under the (false) impression that only one S
521 }
518 522
519 // Stops the sync backend and sets the flag for suppressing sync startup. 523 // Stops the sync backend and sets the flag for suppressing sync startup.
520 void StopAndSuppress(); 524 void StopAndSuppress();
521 525
522 // Resets the flag for suppressing sync startup and starts the sync backend. 526 // Resets the flag for suppressing sync startup and starts the sync backend.
523 void UnsuppressAndStart(); 527 void UnsuppressAndStart();
524 528
525 // Marks all currently registered types as "acknowledged" so we won't prompt 529 // Marks all currently registered types as "acknowledged" so we won't prompt
526 // the user about them any more. 530 // the user about them any more.
527 void AcknowledgeSyncedTypes(); 531 void AcknowledgeSyncedTypes();
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 ERROR_REASON_CONFIGURATION_RETRY, 610 ERROR_REASON_CONFIGURATION_RETRY,
607 ERROR_REASON_CONFIGURATION_FAILURE, 611 ERROR_REASON_CONFIGURATION_FAILURE,
608 ERROR_REASON_ACTIONABLE_ERROR, 612 ERROR_REASON_ACTIONABLE_ERROR,
609 ERROR_REASON_LIMIT 613 ERROR_REASON_LIMIT
610 }; 614 };
611 friend class ProfileSyncServicePasswordTest; 615 friend class ProfileSyncServicePasswordTest;
612 friend class SyncTest; 616 friend class SyncTest;
613 friend class TestProfileSyncService; 617 friend class TestProfileSyncService;
614 FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceTest, InitialState); 618 FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceTest, InitialState);
615 619
620 // Returns true if we are running on Windows 8, the user is not signed in to
621 // sync, sync is not disabled by policy, and startup is not suppressed.
622 // Used to prevent the user from having to sign in twice with the same account
623 // on Metro and Desktop Chrome.
624 bool ShouldInitializeCredentialCacheService();
625
626 // Returns true if we are running on Windows 8, the credential cache service
627 // is up and running, and credentials were successfully loaded from the
628 // alternate profile.
629 bool LoadedCachedCredentials();
630
616 // Starts up sync if it is not suppressed and preconditions are met. 631 // Starts up sync if it is not suppressed and preconditions are met.
617 // Called from Initialize() and UnsuppressAndStart(). 632 // Called from Initialize() and UnsuppressAndStart().
618 void TryStart(); 633 void TryStart();
619 634
620 // Puts the backend's sync scheduler into NORMAL mode. 635 // Puts the backend's sync scheduler into NORMAL mode.
621 // Called when configuration is complete. 636 // Called when configuration is complete.
622 void StartSyncingWithServer(); 637 void StartSyncingWithServer();
623 638
624 // Called when we've determined that we don't need a passphrase (either 639 // Called when we've determined that we don't need a passphrase (either
625 // because OnPassphraseAccepted() was called, or because we've gotten a 640 // because OnPassphraseAccepted() was called, or because we've gotten a
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 // If |true|, there is setup UI visible so we should not start downloading 824 // If |true|, there is setup UI visible so we should not start downloading
810 // data types. 825 // data types.
811 bool setup_in_progress_; 826 bool setup_in_progress_;
812 827
813 // The set of currently enabled sync experiments. 828 // The set of currently enabled sync experiments.
814 syncer::Experiments current_experiments; 829 syncer::Experiments current_experiments;
815 830
816 // Factory the backend will use to build the SyncManager. 831 // Factory the backend will use to build the SyncManager.
817 syncer::SyncManagerFactory sync_manager_factory_; 832 syncer::SyncManagerFactory sync_manager_factory_;
818 833
834 // Used to share sync credentials between Metro and Desktop on Windows 8.
835 syncer::CredentialCacheService* credential_cache_service_;
836
819 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 837 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
820 }; 838 };
821 839
822 bool ShouldShowActionOnUI( 840 bool ShouldShowActionOnUI(
823 const syncer::SyncProtocolError& error); 841 const syncer::SyncProtocolError& error);
824 842
825 843
826 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 844 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698