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 <algorithm> | 7 #include <algorithm> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 if (data_type_manager_.get()) { | 810 if (data_type_manager_.get()) { |
811 // Unblock the data type manager if necessary. | 811 // Unblock the data type manager if necessary. |
812 // This will always trigger a SYNC_CONFIGURE_DONE on completion, which will | 812 // This will always trigger a SYNC_CONFIGURE_DONE on completion, which will |
813 // step the UI wizard into DONE state (even if no datatypes have changed). | 813 // step the UI wizard into DONE state (even if no datatypes have changed). |
814 // This will be ignored, because we will already have transitioned to DONE | 814 // This will be ignored, because we will already have transitioned to DONE |
815 // below. | 815 // below. |
816 data_type_manager_->Configure(types, | 816 data_type_manager_->Configure(types, |
817 sync_api::CONFIGURE_REASON_RECONFIGURATION); | 817 sync_api::CONFIGURE_REASON_RECONFIGURATION); |
818 } | 818 } |
819 | 819 |
820 // No encryption is pending, our passphrase has been accepted, so tell the | 820 // If No encryption is pending and our passphrase has been accepted, tell the |
821 // wizard we're done (no need to hang around waiting for the sync to | 821 // wizard we're done (no need to hang around waiting for the sync to |
822 // complete). | 822 // complete). If encryption is pending, its successful completion will trigger |
823 if (WizardIsVisible()) | 823 // the done step. |
| 824 if (WizardIsVisible() && !encryption_pending()) |
824 wizard_.Step(SyncSetupWizard::DONE); | 825 wizard_.Step(SyncSetupWizard::DONE); |
825 | 826 |
826 NotifyObservers(); | 827 NotifyObservers(); |
827 } | 828 } |
828 | 829 |
829 void ProfileSyncService::OnEncryptionComplete( | 830 void ProfileSyncService::OnEncryptionComplete( |
830 const syncable::ModelTypeSet& encrypted_types) { | 831 const syncable::ModelTypeSet& encrypted_types) { |
831 if (encryption_pending_) { | 832 if (encryption_pending_) { |
832 syncable::ModelTypeSet registered_types; | 833 syncable::ModelTypeSet registered_types; |
833 GetRegisteredDataTypes(®istered_types); | 834 GetRegisteredDataTypes(®istered_types); |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1522 << "Unrecoverable error."; | 1523 << "Unrecoverable error."; |
1523 } else { | 1524 } else { |
1524 VLOG(0) << "ConfigureDataTypeManager not invoked because backend is not " | 1525 VLOG(0) << "ConfigureDataTypeManager not invoked because backend is not " |
1525 << "initialized"; | 1526 << "initialized"; |
1526 } | 1527 } |
1527 } | 1528 } |
1528 | 1529 |
1529 const FailedDatatypesHandler& ProfileSyncService::failed_datatypes_handler() { | 1530 const FailedDatatypesHandler& ProfileSyncService::failed_datatypes_handler() { |
1530 return failed_datatypes_handler_; | 1531 return failed_datatypes_handler_; |
1531 } | 1532 } |
OLD | NEW |