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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 break; | 431 break; |
432 } | 432 } |
433 case SyncSetupWizard::GAIA_LOGIN: { | 433 case SyncSetupWizard::GAIA_LOGIN: { |
434 DictionaryValue args; | 434 DictionaryValue args; |
435 SyncSetupFlow::GetArgsForGaiaLogin(service_, &args); | 435 SyncSetupFlow::GetArgsForGaiaLogin(service_, &args); |
436 flow_handler_->ShowGaiaLogin(args); | 436 flow_handler_->ShowGaiaLogin(args); |
437 break; | 437 break; |
438 } | 438 } |
439 case SyncSetupWizard::GAIA_SUCCESS: | 439 case SyncSetupWizard::GAIA_SUCCESS: |
440 if (end_state_ == SyncSetupWizard::GAIA_SUCCESS) { | 440 if (end_state_ == SyncSetupWizard::GAIA_SUCCESS) { |
| 441 // The user has just re-authed - set the passphrase so we can re-encrypt |
| 442 // if necessary. If we are currently encrypting with an explicit |
| 443 // passphrase, this does nothing. |
| 444 // TODO(atwilson): Move all the code dealing with the implicit GAIA |
| 445 // passphrase back into ProfileSyncService in a |
| 446 // NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL listener once we get rid of |
| 447 // SyncSetupFlow. |
| 448 if (!cached_passphrase_.empty()) |
| 449 service_->SetPassphrase(cached_passphrase_, false); |
441 flow_handler_->ShowGaiaSuccessAndClose(); | 450 flow_handler_->ShowGaiaSuccessAndClose(); |
442 break; | 451 break; |
443 } | 452 } |
444 flow_handler_->ShowGaiaSuccessAndSettingUp(); | 453 flow_handler_->ShowGaiaSuccessAndSettingUp(); |
445 break; | 454 break; |
446 case SyncSetupWizard::SYNC_EVERYTHING: { | 455 case SyncSetupWizard::SYNC_EVERYTHING: { |
447 DictionaryValue args; | 456 DictionaryValue args; |
448 SyncSetupFlow::GetArgsForConfigure(service_, &args); | 457 SyncSetupFlow::GetArgsForConfigure(service_, &args); |
449 args.SetBoolean("showSyncEverythingPage", true); | 458 args.SetBoolean("showSyncEverythingPage", true); |
450 flow_handler_->ShowConfigure(args); | 459 flow_handler_->ShowConfigure(args); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 case SyncSetupWizard::DONE: | 503 case SyncSetupWizard::DONE: |
495 case SyncSetupWizard::ABORT: | 504 case SyncSetupWizard::ABORT: |
496 flow_handler_->ShowSetupDone(UTF8ToUTF16( | 505 flow_handler_->ShowSetupDone(UTF8ToUTF16( |
497 service_->profile()->GetPrefs()->GetString( | 506 service_->profile()->GetPrefs()->GetString( |
498 prefs::kGoogleServicesUsername))); | 507 prefs::kGoogleServicesUsername))); |
499 break; | 508 break; |
500 default: | 509 default: |
501 NOTREACHED() << "Invalid advance state: " << state; | 510 NOTREACHED() << "Invalid advance state: " << state; |
502 } | 511 } |
503 } | 512 } |
OLD | NEW |