OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 virtual bool encryption_pending() const; | 473 virtual bool encryption_pending() const; |
474 | 474 |
475 // Returns whether processing changes is allowed. Check this before doing | 475 // Returns whether processing changes is allowed. Check this before doing |
476 // any model-modifying operations. | 476 // any model-modifying operations. |
477 bool ShouldPushChanges(); | 477 bool ShouldPushChanges(); |
478 | 478 |
479 const GURL& sync_service_url() const { return sync_service_url_; } | 479 const GURL& sync_service_url() const { return sync_service_url_; } |
480 SigninManager* signin() { return signin_.get(); } | 480 SigninManager* signin() { return signin_.get(); } |
481 const std::string& cros_user() const { return cros_user_; } | 481 const std::string& cros_user() const { return cros_user_; } |
482 | 482 |
| 483 // Stops the sync backend and sets the flag for suppressing sync startup. |
| 484 void StopAndSuppress(); |
| 485 |
| 486 // Resets the flag for suppressing sync startup and starts the sync backend. |
| 487 void UnsuppressAndStart(); |
| 488 |
483 // Marks all currently registered types as "acknowledged" so we won't prompt | 489 // Marks all currently registered types as "acknowledged" so we won't prompt |
484 // the user about them any more. | 490 // the user about them any more. |
485 void AcknowledgeSyncedTypes(); | 491 void AcknowledgeSyncedTypes(); |
486 | 492 |
487 SyncGlobalError* sync_global_error() { return sync_global_error_.get(); } | 493 SyncGlobalError* sync_global_error() { return sync_global_error_.get(); } |
488 | 494 |
489 virtual const FailedDatatypesHandler& failed_datatypes_handler(); | 495 virtual const FailedDatatypesHandler& failed_datatypes_handler(); |
490 | 496 |
491 protected: | 497 protected: |
492 // Used by test classes that derive from ProfileSyncService. | 498 // Used by test classes that derive from ProfileSyncService. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 // was required for encryption, decryption with a cached passphrase, or | 540 // was required for encryption, decryption with a cached passphrase, or |
535 // because a new passphrase is required? | 541 // because a new passphrase is required? |
536 sync_api::PassphraseRequiredReason passphrase_required_reason_; | 542 sync_api::PassphraseRequiredReason passphrase_required_reason_; |
537 | 543 |
538 private: | 544 private: |
539 friend class ProfileSyncServicePasswordTest; | 545 friend class ProfileSyncServicePasswordTest; |
540 friend class TestProfileSyncService; | 546 friend class TestProfileSyncService; |
541 friend class ProfileSyncServiceForWizardTest; | 547 friend class ProfileSyncServiceForWizardTest; |
542 FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceTest, InitialState); | 548 FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceTest, InitialState); |
543 | 549 |
| 550 // Starts up sync if it is not suppressed and preconditions are met. |
| 551 // Called from Initialize() and UnsuppressAndStart(). |
| 552 void TryStart(); |
| 553 |
544 // Called when we've determined that we don't need a passphrase (either | 554 // Called when we've determined that we don't need a passphrase (either |
545 // because OnPassphraseAccepted() was called, or because we've gotten a | 555 // because OnPassphraseAccepted() was called, or because we've gotten a |
546 // OnPassphraseRequired() but no data types are enabled). | 556 // OnPassphraseRequired() but no data types are enabled). |
547 void ResolvePassphraseRequired(); | 557 void ResolvePassphraseRequired(); |
548 | 558 |
549 // If |delete_sync_data_folder| is true, then this method will delete all | 559 // If |delete_sync_data_folder| is true, then this method will delete all |
550 // previous "Sync Data" folders. (useful if the folder is partial/corrupt). | 560 // previous "Sync Data" folders. (useful if the folder is partial/corrupt). |
551 void InitializeBackend(bool delete_sync_data_folder); | 561 void InitializeBackend(bool delete_sync_data_folder); |
552 | 562 |
553 // Initializes the various settings from the command line. | 563 // Initializes the various settings from the command line. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 FailedDatatypesHandler failed_datatypes_handler_; | 713 FailedDatatypesHandler failed_datatypes_handler_; |
704 | 714 |
705 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 715 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
706 }; | 716 }; |
707 | 717 |
708 bool ShouldShowActionOnUI( | 718 bool ShouldShowActionOnUI( |
709 const browser_sync::SyncProtocolError& error); | 719 const browser_sync::SyncProtocolError& error); |
710 | 720 |
711 | 721 |
712 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 722 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
OLD | NEW |