| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GLUE_SYNC_BACKEND_HOST_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 | 447 |
| 448 // Invoked when the set of encrypted types or the encrypt | 448 // Invoked when the set of encrypted types or the encrypt |
| 449 // everything flag changes. | 449 // everything flag changes. |
| 450 void NotifyEncryptedTypesChanged( | 450 void NotifyEncryptedTypesChanged( |
| 451 syncer::ModelTypeSet encrypted_types, | 451 syncer::ModelTypeSet encrypted_types, |
| 452 bool encrypt_everything); | 452 bool encrypt_everything); |
| 453 | 453 |
| 454 // Invoked when sync finishes encrypting new datatypes. | 454 // Invoked when sync finishes encrypting new datatypes. |
| 455 void NotifyEncryptionComplete(); | 455 void NotifyEncryptionComplete(); |
| 456 | 456 |
| 457 // Invoked when the passphrase state has changed. Caches the passphrase state |
| 458 // for later use on the UI thread. |
| 459 void HandlePassphraseStateChangedOnFrontendLoop( |
| 460 syncer::PassphraseState state); |
| 461 |
| 457 void HandleStopSyncingPermanentlyOnFrontendLoop(); | 462 void HandleStopSyncingPermanentlyOnFrontendLoop(); |
| 458 | 463 |
| 459 // Dispatched to from OnConnectionStatusChange to handle updating | 464 // Dispatched to from OnConnectionStatusChange to handle updating |
| 460 // frontend UI components. | 465 // frontend UI components. |
| 461 void HandleConnectionStatusChangeOnFrontendLoop( | 466 void HandleConnectionStatusChangeOnFrontendLoop( |
| 462 syncer::ConnectionStatus status); | 467 syncer::ConnectionStatus status); |
| 463 | 468 |
| 464 // Called when configuration of the Nigori node has completed as | 469 // Called when configuration of the Nigori node has completed as |
| 465 // part of the initialization process. | 470 // part of the initialization process. |
| 466 void HandleNigoriConfigurationCompletedOnFrontendLoop( | 471 void HandleNigoriConfigurationCompletedOnFrontendLoop( |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 // We cache the cryptographer's pending keys whenever NotifyPassphraseRequired | 520 // We cache the cryptographer's pending keys whenever NotifyPassphraseRequired |
| 516 // is called. This way, before the UI calls SetDecryptionPassphrase on the | 521 // is called. This way, before the UI calls SetDecryptionPassphrase on the |
| 517 // syncer, it can avoid the overhead of an asynchronous decryption call and | 522 // syncer, it can avoid the overhead of an asynchronous decryption call and |
| 518 // give the user immediate feedback about the passphrase entered by first | 523 // give the user immediate feedback about the passphrase entered by first |
| 519 // trying to decrypt the cached pending keys on the UI thread. Note that | 524 // trying to decrypt the cached pending keys on the UI thread. Note that |
| 520 // SetDecryptionPassphrase can still fail after the cached pending keys are | 525 // SetDecryptionPassphrase can still fail after the cached pending keys are |
| 521 // successfully decrypted if the pending keys have changed since the time they | 526 // successfully decrypted if the pending keys have changed since the time they |
| 522 // were cached. | 527 // were cached. |
| 523 sync_pb::EncryptedData cached_pending_keys_; | 528 sync_pb::EncryptedData cached_pending_keys_; |
| 524 | 529 |
| 530 // The state of the passphrase required to decrypt the bag of encryption keys |
| 531 // in the nigori node. Updated whenever a new nigori node arrives or the user |
| 532 // manually changes their passphrase state. Cached so we can synchronously |
| 533 // check it from the UI thread. |
| 534 syncer::PassphraseState cached_passphrase_state_; |
| 535 |
| 525 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. | 536 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. |
| 526 syncer::sessions::SyncSessionSnapshot last_snapshot_; | 537 syncer::sessions::SyncSessionSnapshot last_snapshot_; |
| 527 | 538 |
| 528 // Temporary holder for the javascript backend. Set by | 539 // Temporary holder for the javascript backend. Set by |
| 529 // HandleSyncManagerInitializationOnFrontendLoop, and consumed when we pass | 540 // HandleSyncManagerInitializationOnFrontendLoop, and consumed when we pass |
| 530 // it via OnBackendInitialized in the final state of | 541 // it via OnBackendInitialized in the final state of |
| 531 // HandleInitializationCompletedOnFrontendLoop. | 542 // HandleInitializationCompletedOnFrontendLoop. |
| 532 syncer::WeakHandle<syncer::JsBackend> js_backend_; | 543 syncer::WeakHandle<syncer::JsBackend> js_backend_; |
| 533 | 544 |
| 534 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 545 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
| 535 }; | 546 }; |
| 536 | 547 |
| 537 } // namespace browser_sync | 548 } // namespace browser_sync |
| 538 | 549 |
| 539 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 550 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| OLD | NEW |