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