| 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/sync_setup_flow.h" | 5 #include "chrome/browser/sync/sync_setup_flow.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 } | 327 } |
| 328 } | 328 } |
| 329 | 329 |
| 330 service_->OnUserChoseDatatypes(configuration.sync_everything, | 330 service_->OnUserChoseDatatypes(configuration.sync_everything, |
| 331 configuration.data_types); | 331 configuration.data_types); |
| 332 | 332 |
| 333 // See if we are done configuring (if we don't need a passphrase, and don't | 333 // See if we are done configuring (if we don't need a passphrase, and don't |
| 334 // need to hang around waiting for encryption to happen, just exit). This call | 334 // need to hang around waiting for encryption to happen, just exit). This call |
| 335 // to IsPassphraseRequiredForDecryption() takes into account the data types | 335 // to IsPassphraseRequiredForDecryption() takes into account the data types |
| 336 // we just enabled/disabled. | 336 // we just enabled/disabled. |
| 337 if (!service_->IsPassphraseRequiredForDecryption()) { | 337 if (!service_->IsPassphraseRequiredForDecryption() && |
| 338 !service_->encryption_pending()) { |
| 338 Advance(SyncSetupWizard::DONE); | 339 Advance(SyncSetupWizard::DONE); |
| 339 } else if (!set_new_decryption_passphrase) { | 340 } else if (!set_new_decryption_passphrase) { |
| 340 // We need a passphrase, but the user did not provide one, so transition | 341 // We need a passphrase, but the user did not provide one, so transition |
| 341 // directly to ENTER_PASSPHRASE (otherwise we'll have to wait until | 342 // directly to ENTER_PASSPHRASE (otherwise we'll have to wait until |
| 342 // the sync engine generates another OnPassphraseRequired() at the end of | 343 // the sync engine generates another OnPassphraseRequired() at the end of |
| 343 // the sync cycle which can take a long time). | 344 // the sync cycle which can take a long time). |
| 344 Advance(SyncSetupWizard::ENTER_PASSPHRASE); | 345 Advance(SyncSetupWizard::ENTER_PASSPHRASE); |
| 345 } | 346 } |
| 346 } | 347 } |
| 347 | 348 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 } | 493 } |
| 493 case SyncSetupWizard::DONE: | 494 case SyncSetupWizard::DONE: |
| 494 case SyncSetupWizard::ABORT: | 495 case SyncSetupWizard::ABORT: |
| 495 flow_handler_->ShowSetupDone( | 496 flow_handler_->ShowSetupDone( |
| 496 UTF16ToWide(service_->GetAuthenticatedUsername())); | 497 UTF16ToWide(service_->GetAuthenticatedUsername())); |
| 497 break; | 498 break; |
| 498 default: | 499 default: |
| 499 NOTREACHED() << "Invalid advance state: " << state; | 500 NOTREACHED() << "Invalid advance state: " << state; |
| 500 } | 501 } |
| 501 } | 502 } |
| OLD | NEW |