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 <string> | 9 #include <string> |
10 | 10 |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 | 433 |
434 // Returns true if a secondary passphrase is being used. | 434 // Returns true if a secondary passphrase is being used. |
435 virtual bool IsUsingSecondaryPassphrase() const; | 435 virtual bool IsUsingSecondaryPassphrase() const; |
436 | 436 |
437 // Sets the Cryptographer's passphrase, or caches it until that is possible. | 437 // Sets the Cryptographer's passphrase, or caches it until that is possible. |
438 // This will check asynchronously whether the passphrase is valid and notify | 438 // This will check asynchronously whether the passphrase is valid and notify |
439 // ProfileSyncServiceObservers via the NotificationService when the outcome | 439 // ProfileSyncServiceObservers via the NotificationService when the outcome |
440 // is known. | 440 // is known. |
441 // |is_explicit| is true if the call is in response to the user explicitly | 441 // |is_explicit| is true if the call is in response to the user explicitly |
442 // setting a passphrase as opposed to implicitly (from the users' perspective) | 442 // setting a passphrase as opposed to implicitly (from the users' perspective) |
443 // using their Google Account password. An implicit SetPassphrase will *not* | 443 // using their Google Account password. An implicit SetPassphrase will |
444 // *not* override an explicit passphrase set previously. | 444 // *not* override an explicit passphrase set previously. |
445 // |is_creation| is true if the call is in response to the user setting | |
446 // up a new passphrase, and false if it's being set in response to a prompt | |
447 // for an existing passphrase. | |
448 virtual void SetPassphrase(const std::string& passphrase, | 445 virtual void SetPassphrase(const std::string& passphrase, |
449 bool is_explicit, | 446 bool is_explicit); |
450 bool is_creation); | |
451 | 447 |
452 // Sets the set of datatypes that are waiting for encryption | 448 // Sets the set of datatypes that are waiting for encryption |
453 // (pending_types_for_encryption_). | 449 // (pending_types_for_encryption_). |
454 // Note that this does not trigger the actual encryption. The encryption call | 450 // Note that this does not trigger the actual encryption. The encryption call |
455 // is kicked off automatically the next time the datatype manager is | 451 // is kicked off automatically the next time the datatype manager is |
456 // reconfigured. | 452 // reconfigured. |
457 virtual void set_pending_types_for_encryption( | 453 virtual void set_pending_types_for_encryption( |
458 const syncable::ModelTypeSet& encrypted_types); | 454 const syncable::ModelTypeSet& encrypted_types); |
459 | 455 |
460 // Get the currently encrypted data types. | 456 // Get the currently encrypted data types. |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 | 624 |
629 // This allows us to gracefully handle an ABORTED return code from the | 625 // This allows us to gracefully handle an ABORTED return code from the |
630 // DataTypeManager in the event that the server informed us to cease and | 626 // DataTypeManager in the event that the server informed us to cease and |
631 // desist syncing immediately. | 627 // desist syncing immediately. |
632 bool expect_sync_configuration_aborted_; | 628 bool expect_sync_configuration_aborted_; |
633 | 629 |
634 // Sometimes we need to temporarily hold on to a passphrase because we don't | 630 // Sometimes we need to temporarily hold on to a passphrase because we don't |
635 // yet have a backend to send it to. This happens during initialization as | 631 // yet have a backend to send it to. This happens during initialization as |
636 // we don't StartUp until we have a valid token, which happens after valid | 632 // we don't StartUp until we have a valid token, which happens after valid |
637 // credentials were provided. | 633 // credentials were provided. |
638 struct CachedPassphrase { | 634 struct CachedPassphrases { |
639 std::string value; | 635 std::string explicit_passphrase; |
640 bool is_explicit; | 636 std::string gaia_passphrase; |
641 bool is_creation; | |
642 CachedPassphrase() : is_explicit(false), is_creation(false) {} | |
643 }; | 637 }; |
644 CachedPassphrase cached_passphrase_; | 638 CachedPassphrases cached_passphrases_; |
645 | |
646 // TODO(lipalani): Bug 82221 unify this with the CachedPassphrase struct. | |
647 std::string gaia_password_; | |
648 | 639 |
649 // Keep track of where we are in a server clear operation | 640 // Keep track of where we are in a server clear operation |
650 ClearServerDataState clear_server_data_state_; | 641 ClearServerDataState clear_server_data_state_; |
651 | 642 |
652 // Timeout for the clear data command. This timeout is a temporary hack | 643 // Timeout for the clear data command. This timeout is a temporary hack |
653 // and is necessary because the nudge sync framework can drop nudges for | 644 // and is necessary because the nudge sync framework can drop nudges for |
654 // a wide variety of sync-related conditions (throttling, connections issues, | 645 // a wide variety of sync-related conditions (throttling, connections issues, |
655 // syncer paused, etc.). It can only be removed correctly when the framework | 646 // syncer paused, etc.). It can only be removed correctly when the framework |
656 // is reworked to allow one-shot commands like clearing server data. | 647 // is reworked to allow one-shot commands like clearing server data. |
657 base::OneShotTimer<ProfileSyncService> clear_server_data_timer_; | 648 base::OneShotTimer<ProfileSyncService> clear_server_data_timer_; |
658 | 649 |
659 // The most recently requested set of types to encrypt. Set by the user, | 650 // The most recently requested set of types to encrypt. Set by the user, |
660 // and cached until the syncer either finishes encryption | 651 // and cached until the syncer either finishes encryption |
661 // (OnEncryptionComplete) or the user cancels. | 652 // (OnEncryptionComplete) or the user cancels. |
662 syncable::ModelTypeSet pending_types_for_encryption_; | 653 syncable::ModelTypeSet pending_types_for_encryption_; |
663 bool set_backend_encrypted_types_; | 654 bool set_backend_encrypted_types_; |
664 | 655 |
| 656 // If true, we want to automatically start sync signin whenever we have |
| 657 // credentials (user doesn't need to go through the startup flow). This is |
| 658 // typically enabled on platforms (like ChromeOS) that have their own |
| 659 // distinct signin flow. |
| 660 bool auto_start_enabled_; |
| 661 |
665 scoped_ptr<browser_sync::BackendMigrator> migrator_; | 662 scoped_ptr<browser_sync::BackendMigrator> migrator_; |
666 | 663 |
667 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 664 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
668 }; | 665 }; |
669 | 666 |
670 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 667 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
OLD | NEW |