| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 syncable::ModelTypeSet data_types; | 266 syncable::ModelTypeSet data_types; |
| 267 service_->GetRegisteredDataTypes(&data_types); | 267 service_->GetRegisteredDataTypes(&data_types); |
| 268 service_->EncryptDataTypes(data_types); | 268 service_->EncryptDataTypes(data_types); |
| 269 } | 269 } |
| 270 | 270 |
| 271 // If we are activating the passphrase, we need to have one supplied. | 271 // If we are activating the passphrase, we need to have one supplied. |
| 272 DCHECK(service_->IsUsingSecondaryPassphrase() || | 272 DCHECK(service_->IsUsingSecondaryPassphrase() || |
| 273 !configuration.use_secondary_passphrase || | 273 !configuration.use_secondary_passphrase || |
| 274 configuration.secondary_passphrase.length() > 0); | 274 configuration.secondary_passphrase.length() > 0); |
| 275 | 275 |
| 276 if (!configuration.gaia_passphrase.empty()) { |
| 277 // Caller passed a gaia passphrase. This is illegal if we are currently |
| 278 // using a secondary passphrase. |
| 279 DCHECK(!service_->IsUsingSecondaryPassphrase()); |
| 280 service_->SetPassphrase(configuration.gaia_passphrase, false, false); |
| 281 } |
| 282 |
| 276 if (configuration.use_secondary_passphrase) { | 283 if (configuration.use_secondary_passphrase) { |
| 277 if (!service_->IsUsingSecondaryPassphrase()) { | 284 if (!service_->IsUsingSecondaryPassphrase()) { |
| 278 service_->SetPassphrase(configuration.secondary_passphrase, true, true); | 285 service_->SetPassphrase(configuration.secondary_passphrase, true, true); |
| 279 tried_creating_explicit_passphrase_ = true; | 286 tried_creating_explicit_passphrase_ = true; |
| 280 } else { | 287 } else { |
| 281 service_->SetPassphrase(configuration.secondary_passphrase, true, false); | 288 service_->SetPassphrase(configuration.secondary_passphrase, true, false); |
| 282 tried_setting_explicit_passphrase_ = true; | 289 tried_setting_explicit_passphrase_ = true; |
| 283 } | 290 } |
| 284 } | 291 } |
| 285 | 292 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 break; | 434 break; |
| 428 } | 435 } |
| 429 case SyncSetupWizard::DONE: | 436 case SyncSetupWizard::DONE: |
| 430 flow_handler_->ShowSetupDone( | 437 flow_handler_->ShowSetupDone( |
| 431 UTF16ToWide(service_->GetAuthenticatedUsername())); | 438 UTF16ToWide(service_->GetAuthenticatedUsername())); |
| 432 break; | 439 break; |
| 433 default: | 440 default: |
| 434 NOTREACHED() << "Invalid advance state: " << state; | 441 NOTREACHED() << "Invalid advance state: " << state; |
| 435 } | 442 } |
| 436 } | 443 } |
| OLD | NEW |