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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 // setting a passphrase as opposed to implicitly (from the users' perspective) | 438 // setting a passphrase as opposed to implicitly (from the users' perspective) |
439 // using their Google Account password. An implicit SetPassphrase will *not* | 439 // using their Google Account password. An implicit SetPassphrase will *not* |
440 // *not* override an explicit passphrase set previously. | 440 // *not* override an explicit passphrase set previously. |
441 // |is_creation| is true if the call is in response to the user setting | 441 // |is_creation| is true if the call is in response to the user setting |
442 // up a new passphrase, and false if it's being set in response to a prompt | 442 // up a new passphrase, and false if it's being set in response to a prompt |
443 // for an existing passphrase. | 443 // for an existing passphrase. |
444 virtual void SetPassphrase(const std::string& passphrase, | 444 virtual void SetPassphrase(const std::string& passphrase, |
445 bool is_explicit, | 445 bool is_explicit, |
446 bool is_creation); | 446 bool is_creation); |
447 | 447 |
448 // Changes the set of datatypes that require encryption. This affects all | 448 // Sets the set of datatypes that are waiting for encryption |
449 // machines synced to this account and all data belonging to the specified | 449 // (pending_types_for_encryption_). |
450 // types. | 450 // Note that this does not trigger the actual encryption. The encryption call |
451 // Note that this is an asynchronous operation (the encryption of data is | 451 // is kicked off automatically the next time the datatype manager is |
452 // performed on SyncBackendHost's core thread) and may not have an immediate | 452 // reconfigured. |
453 // effect. | 453 virtual void set_pending_types_for_encryption( |
454 virtual void EncryptDataTypes( | |
455 const syncable::ModelTypeSet& encrypted_types); | 454 const syncable::ModelTypeSet& encrypted_types); |
456 | 455 |
457 // Get the currently encrypted data types. | 456 // Get the currently encrypted data types. |
458 // Note: this can include types that this client is not syncing. Passwords | 457 // Note: this can include types that this client is not syncing. Passwords |
459 // will always be in this list. | 458 // will always be in this list. |
460 virtual void GetEncryptedDataTypes( | 459 virtual void GetEncryptedDataTypes( |
461 syncable::ModelTypeSet* encrypted_types) const; | 460 syncable::ModelTypeSet* encrypted_types) const; |
462 | 461 |
| 462 // Returns true if the syncer is waiting for new datatypes to be encrypted. |
| 463 virtual bool HasPendingEncryptedTypes() const; |
| 464 |
463 // Returns whether processing changes is allowed. Check this before doing | 465 // Returns whether processing changes is allowed. Check this before doing |
464 // any model-modifying operations. | 466 // any model-modifying operations. |
465 bool ShouldPushChanges(); | 467 bool ShouldPushChanges(); |
466 | 468 |
467 const GURL& sync_service_url() const { return sync_service_url_; } | 469 const GURL& sync_service_url() const { return sync_service_url_; } |
468 SigninManager* signin() { return signin_.get(); } | 470 SigninManager* signin() { return signin_.get(); } |
469 const std::string& cros_user() const { return cros_user_; } | 471 const std::string& cros_user() const { return cros_user_; } |
470 | 472 |
471 protected: | 473 protected: |
472 // Used by test classes that derive from ProfileSyncService. | 474 // Used by test classes that derive from ProfileSyncService. |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 ClearServerDataState clear_server_data_state_; | 630 ClearServerDataState clear_server_data_state_; |
629 | 631 |
630 // Timeout for the clear data command. This timeout is a temporary hack | 632 // Timeout for the clear data command. This timeout is a temporary hack |
631 // and is necessary because the nudge sync framework can drop nudges for | 633 // and is necessary because the nudge sync framework can drop nudges for |
632 // a wide variety of sync-related conditions (throttling, connections issues, | 634 // a wide variety of sync-related conditions (throttling, connections issues, |
633 // syncer paused, etc.). It can only be removed correctly when the framework | 635 // syncer paused, etc.). It can only be removed correctly when the framework |
634 // is reworked to allow one-shot commands like clearing server data. | 636 // is reworked to allow one-shot commands like clearing server data. |
635 base::OneShotTimer<ProfileSyncService> clear_server_data_timer_; | 637 base::OneShotTimer<ProfileSyncService> clear_server_data_timer_; |
636 | 638 |
637 // The most recently requested set of types to encrypt. Set by the user, | 639 // The most recently requested set of types to encrypt. Set by the user, |
638 // and cached if the syncer was unable to encrypt new types (for example | 640 // and cached until the syncer either finishes encryption |
639 // because we haven't finished initializing). Cleared when we successfully | 641 // (OnEncryptionComplete) or the user cancels. |
640 // post a new encrypt task to the sync backend. | |
641 syncable::ModelTypeSet pending_types_for_encryption_; | 642 syncable::ModelTypeSet pending_types_for_encryption_; |
642 | 643 |
643 scoped_ptr<browser_sync::BackendMigrator> migrator_; | 644 scoped_ptr<browser_sync::BackendMigrator> migrator_; |
644 | 645 |
645 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 646 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
646 }; | 647 }; |
647 | 648 |
648 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 649 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
OLD | NEW |