Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(683)

Unified Diff: chrome/browser/resources/chromeos/login/screen_encryption_migration.js

Issue 2784273003: Implement a basic UI flow for cryptohome encryption migration. (Closed)
Patch Set: Address review comments. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/login/screen_encryption_migration.js
diff --git a/chrome/browser/resources/chromeos/login/screen_encryption_migration.js b/chrome/browser/resources/chromeos/login/screen_encryption_migration.js
index f0d681a59efda402c33e9bd190293dffd44698d6..440a58bd4debecfecf4ea2055844ef0d0f8496d0 100644
--- a/chrome/browser/resources/chromeos/login/screen_encryption_migration.js
+++ b/chrome/browser/resources/chromeos/login/screen_encryption_migration.js
@@ -6,6 +6,8 @@ login.createScreen('EncryptionMigrationScreen', 'encryption-migration',
function() {
return {
EXTERNAL_API: [
+ 'setUIState',
+ 'setMigrationProgress',
],
/**
@@ -15,6 +17,13 @@ login.createScreen('EncryptionMigrationScreen', 'encryption-migration',
/** @override */
decorate: function() {
+ var encryptionMigration = $('encryption-migration-element');
+ encryptionMigration.addEventListener('upgrade', function() {
+ chrome.send('startMigration');
+ });
+ encryptionMigration.addEventListener('restart', function() {
+ chrome.send('requestRestart');
+ });
},
/**
@@ -28,5 +37,22 @@ login.createScreen('EncryptionMigrationScreen', 'encryption-migration',
headerBar.showCreateSupervisedButton = false;
headerBar.signinUIState = SIGNIN_UI_STATE.HIDDEN;
},
+
+ /**
+ * Updates the migration screen by specifying a state which corresponds to
+ * a sub step in the migration process.
+ * @param {number} state The UI state to identify a sub step in migration.
+ */
+ setUIState: function(state) {
+ $('encryption-migration-element').uiState = state;
+ },
+
+ /**
+ * Updates the migration progress.
+ * @param {number} progress The progress of migration in range [0, 1].
+ */
+ setMigrationProgress: function(progress) {
+ $('encryption-migration-element').progress = progress;
+ },
};
});

Powered by Google App Engine
This is Rietveld 408576698