| Index: chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
|
| diff --git a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
|
| index d0299c45535225b7fdb51894e7d45d755df96483..ef973f55a743b9ac16cbeb33ad84fe120090da2b 100644
|
| --- a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
|
| +++ b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
|
| @@ -8,6 +8,7 @@
|
| #include "chromeos/cryptohome/homedir_methods.h"
|
| #include "chromeos/dbus/cryptohome_client.h"
|
| #include "chromeos/dbus/dbus_thread_manager.h"
|
| +#include "chromeos/login/auth/login_performer.h"
|
|
|
| namespace {
|
|
|
| @@ -15,6 +16,7 @@ constexpr char kJsScreenPath[] = "login.EncryptionMigrationScreen";
|
|
|
| // JS API callbacks names.
|
| constexpr char kJsApiStartMigration[] = "startMigration";
|
| +constexpr char kJsApiSkipMigration[] = "skipMigration";
|
| constexpr char kJsApiRequestRestart[] = "requestRestart";
|
|
|
| } // namespace
|
| @@ -54,6 +56,11 @@ void EncryptionMigrationScreenHandler::SetUserContext(
|
| user_context_ = user_context;
|
| }
|
|
|
| +void EncryptionMigrationScreenHandler::SetLoginPerformer(
|
| + LoginPerformer* login_performer) {
|
| + login_performer_ = login_performer;
|
| +}
|
| +
|
| void EncryptionMigrationScreenHandler::DeclareLocalizedValues(
|
| ::login::LocalizedValuesBuilder* builder) {}
|
|
|
| @@ -70,6 +77,8 @@ void EncryptionMigrationScreenHandler::Initialize() {
|
| void EncryptionMigrationScreenHandler::RegisterMessages() {
|
| AddCallback(kJsApiStartMigration,
|
| &EncryptionMigrationScreenHandler::HandleStartMigration);
|
| + AddCallback(kJsApiSkipMigration,
|
| + &EncryptionMigrationScreenHandler::HandleSkipMigration);
|
| AddCallback(kJsApiRequestRestart,
|
| &EncryptionMigrationScreenHandler::HandleRequestRestart);
|
| }
|
| @@ -78,6 +87,16 @@ void EncryptionMigrationScreenHandler::HandleStartMigration() {
|
| StartMigration();
|
| }
|
|
|
| +void EncryptionMigrationScreenHandler::HandleSkipMigration() {
|
| + // If the user skips migration, we mount the cryptohome without performing the
|
| + // migration by reusing UserContext and LoginPerformer which were used in the
|
| + // previous attempt and dropping |is_forcing_dircrypto| flag in UserContext.
|
| + // In this case, the user can not launch ARC apps in the session, and will be
|
| + // asked to do the migration again in the next log-in attempt.
|
| + user_context_.SetIsForcingDircrypto(false);
|
| + login_performer_->PerformLogin(user_context_, login_performer_->auth_mode());
|
| +}
|
| +
|
| void EncryptionMigrationScreenHandler::HandleRequestRestart() {
|
| // TODO(fukino): If the migration finished successfully, we don't need to
|
| // restart the device. Let's sign in to the desktop using the already-provided
|
| @@ -117,6 +136,7 @@ void EncryptionMigrationScreenHandler::StartMigration() {
|
| cryptohome::Authorization(auth_key),
|
| base::Bind(&EncryptionMigrationScreenHandler::OnMigrationRequested,
|
| weak_ptr_factory_.GetWeakPtr()));
|
| + UpdateUIState(UIState::MIGRATING);
|
| }
|
|
|
| void EncryptionMigrationScreenHandler::OnMigrationProgress(
|
|
|