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