| 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 #include "chrome/browser/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 // we want UI to update itself and no longer allow the user to press "clear" | 591 // we want UI to update itself and no longer allow the user to press "clear" |
| 592 if (clear_server_data_state_ != CLEAR_SUCCEEDED) { | 592 if (clear_server_data_state_ != CLEAR_SUCCEEDED) { |
| 593 clear_server_data_state_ = CLEAR_SUCCEEDED; | 593 clear_server_data_state_ = CLEAR_SUCCEEDED; |
| 594 NotifyObservers(); | 594 NotifyObservers(); |
| 595 } | 595 } |
| 596 } | 596 } |
| 597 | 597 |
| 598 void ProfileSyncService::OnPassphraseRequired(bool for_decryption) { | 598 void ProfileSyncService::OnPassphraseRequired(bool for_decryption) { |
| 599 DCHECK(backend_.get()); | 599 DCHECK(backend_.get()); |
| 600 DCHECK(backend_->IsNigoriEnabled()); | 600 DCHECK(backend_->IsNigoriEnabled()); |
| 601 |
| 602 // TODO(lipalani) : add this check to other locations as well. |
| 603 if (unrecoverable_error_detected_) { |
| 604 // When unrecoverable error is detected we post a task to shutdown the |
| 605 // backend. The task might not have executed yet. |
| 606 return; |
| 607 } |
| 601 observed_passphrase_required_ = true; | 608 observed_passphrase_required_ = true; |
| 602 passphrase_required_for_decryption_ = for_decryption; | 609 passphrase_required_for_decryption_ = for_decryption; |
| 603 | 610 |
| 604 if (!cached_passphrase_.value.empty()) { | 611 if (!cached_passphrase_.value.empty()) { |
| 605 SetPassphrase(cached_passphrase_.value, | 612 SetPassphrase(cached_passphrase_.value, |
| 606 cached_passphrase_.is_explicit, | 613 cached_passphrase_.is_explicit, |
| 607 cached_passphrase_.is_creation); | 614 cached_passphrase_.is_creation); |
| 608 cached_passphrase_ = CachedPassphrase(); | 615 cached_passphrase_ = CachedPassphrase(); |
| 609 return; | 616 return; |
| 610 } | 617 } |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1260 // is initialized, all enabled data types are consistent with one | 1267 // is initialized, all enabled data types are consistent with one |
| 1261 // another, and no unrecoverable error has transpired. | 1268 // another, and no unrecoverable error has transpired. |
| 1262 if (unrecoverable_error_detected_) | 1269 if (unrecoverable_error_detected_) |
| 1263 return false; | 1270 return false; |
| 1264 | 1271 |
| 1265 if (!data_type_manager_.get()) | 1272 if (!data_type_manager_.get()) |
| 1266 return false; | 1273 return false; |
| 1267 | 1274 |
| 1268 return data_type_manager_->state() == DataTypeManager::CONFIGURED; | 1275 return data_type_manager_->state() == DataTypeManager::CONFIGURED; |
| 1269 } | 1276 } |
| OLD | NEW |