| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 // SyncFrontend implementation. | 183 // SyncFrontend implementation. |
| 184 virtual void OnBackendInitialized(); | 184 virtual void OnBackendInitialized(); |
| 185 virtual void OnSyncCycleCompleted(); | 185 virtual void OnSyncCycleCompleted(); |
| 186 virtual void OnAuthError(); | 186 virtual void OnAuthError(); |
| 187 virtual void OnStopSyncingPermanently(); | 187 virtual void OnStopSyncingPermanently(); |
| 188 virtual void OnClearServerDataFailed(); | 188 virtual void OnClearServerDataFailed(); |
| 189 virtual void OnClearServerDataTimeout(); | 189 virtual void OnClearServerDataTimeout(); |
| 190 virtual void OnClearServerDataSucceeded(); | 190 virtual void OnClearServerDataSucceeded(); |
| 191 virtual void OnPassphraseRequired(bool for_decryption); | 191 virtual void OnPassphraseRequired(bool for_decryption); |
| 192 virtual void OnPassphraseAccepted(); | 192 virtual void OnPassphraseAccepted(); |
| 193 virtual void OnEncryptionComplete( | |
| 194 const syncable::ModelTypeSet& encrypted_types); | |
| 195 | 193 |
| 196 // Called when a user enters credentials through UI. | 194 // Called when a user enters credentials through UI. |
| 197 virtual void OnUserSubmittedAuth(const std::string& username, | 195 virtual void OnUserSubmittedAuth(const std::string& username, |
| 198 const std::string& password, | 196 const std::string& password, |
| 199 const std::string& captcha, | 197 const std::string& captcha, |
| 200 const std::string& access_code); | 198 const std::string& access_code); |
| 201 | 199 |
| 202 // Update the last auth error and notify observers of error state. | 200 // Update the last auth error and notify observers of error state. |
| 203 void UpdateAuthErrorState(const GoogleServiceAuthError& error); | 201 void UpdateAuthErrorState(const GoogleServiceAuthError& error); |
| 204 | 202 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 // setting a passphrase as opposed to implicitly (from the users' perspective) | 427 // setting a passphrase as opposed to implicitly (from the users' perspective) |
| 430 // using their Google Account password. An implicit SetPassphrase will *not* | 428 // using their Google Account password. An implicit SetPassphrase will *not* |
| 431 // *not* override an explicit passphrase set previously. | 429 // *not* override an explicit passphrase set previously. |
| 432 // |is_creation| is true if the call is in response to the user setting | 430 // |is_creation| is true if the call is in response to the user setting |
| 433 // up a new passphrase, and false if it's being set in response to a prompt | 431 // up a new passphrase, and false if it's being set in response to a prompt |
| 434 // for an existing passphrase. | 432 // for an existing passphrase. |
| 435 virtual void SetPassphrase(const std::string& passphrase, | 433 virtual void SetPassphrase(const std::string& passphrase, |
| 436 bool is_explicit, | 434 bool is_explicit, |
| 437 bool is_creation); | 435 bool is_creation); |
| 438 | 436 |
| 439 // Changes the set of datatypes that require encryption. This affects all | |
| 440 // machines synced to this account and all data belonging to the specified | |
| 441 // types. | |
| 442 // Note that this is an asynchronous operation (the encryption of data is | |
| 443 // performed on SyncBackendHost's core thread) and may not have an immediate | |
| 444 // effect. | |
| 445 virtual void EncryptDataTypes( | |
| 446 const syncable::ModelTypeSet& encrypted_types); | |
| 447 | |
| 448 // Get the currently encrypted data types. | |
| 449 virtual void GetEncryptedDataTypes( | |
| 450 syncable::ModelTypeSet* encrypted_types) const; | |
| 451 | |
| 452 // Returns whether processing changes is allowed. Check this before doing | 437 // Returns whether processing changes is allowed. Check this before doing |
| 453 // any model-modifying operations. | 438 // any model-modifying operations. |
| 454 bool ShouldPushChanges(); | 439 bool ShouldPushChanges(); |
| 455 | 440 |
| 456 const GURL& sync_service_url() const { return sync_service_url_; } | 441 const GURL& sync_service_url() const { return sync_service_url_; } |
| 457 SigninManager* signin() { return signin_.get(); } | 442 SigninManager* signin() { return signin_.get(); } |
| 458 const std::string& cros_user() const { return cros_user_; } | 443 const std::string& cros_user() const { return cros_user_; } |
| 459 | 444 |
| 460 protected: | 445 protected: |
| 461 // Used by ProfileSyncServiceMock only. | 446 // Used by ProfileSyncServiceMock only. |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 // Keep track of where we are in a server clear operation | 633 // Keep track of where we are in a server clear operation |
| 649 ClearServerDataState clear_server_data_state_; | 634 ClearServerDataState clear_server_data_state_; |
| 650 | 635 |
| 651 // Timeout for the clear data command. This timeout is a temporary hack | 636 // 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 | 637 // and is necessary because the nudge sync framework can drop nudges for |
| 653 // a wide variety of sync-related conditions (throttling, connections issues, | 638 // a wide variety of sync-related conditions (throttling, connections issues, |
| 654 // syncer paused, etc.). It can only be removed correctly when the framework | 639 // syncer paused, etc.). It can only be removed correctly when the framework |
| 655 // is reworked to allow one-shot commands like clearing server data. | 640 // is reworked to allow one-shot commands like clearing server data. |
| 656 base::OneShotTimer<ProfileSyncService> clear_server_data_timer_; | 641 base::OneShotTimer<ProfileSyncService> clear_server_data_timer_; |
| 657 | 642 |
| 658 // The set of encrypted types. This is updated whenever datatypes are | |
| 659 // encrypted through the OnEncryptionComplete callback of SyncFrontend. | |
| 660 syncable::ModelTypeSet encrypted_types_; | |
| 661 | |
| 662 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 643 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
| 663 }; | 644 }; |
| 664 | 645 |
| 665 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 646 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |