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

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

Issue 1029053002: Back button for the WebView-based sign-in flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit. Created 5 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_gaia_signin.js
diff --git a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
index f1a3714856af8ac24df6ce1340b6a79ddff4e0eb..be55635ba50cd29a2be8aecdb4e04947dc72fd4d 100644
--- a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
+++ b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
@@ -119,6 +119,8 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
'dialogShown', this.onDialogShown_.bind(this));
this.gaiaAuthHost_.addEventListener(
'dialogHidden', this.onDialogHidden_.bind(this));
+ this.gaiaAuthHost_.addEventListener(
+ 'backButton', this.onBackButton_.bind(this));
this.gaiaAuthHost_.confirmPasswordCallback =
this.onAuthConfirmPassword_.bind(this);
this.gaiaAuthHost_.noPasswordCallback =
@@ -139,6 +141,11 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
e.preventDefault();
});
+ $('back-button-item').addEventListener('click', function(e) {
+ $('back-button-item').hidden = true;
+ $('signin-frame').back();
+ e.preventDefault();
+ }.bind(this));
$('close-button-item').addEventListener('click', function(e) {
this.cancel();
e.preventDefault();
@@ -261,6 +268,8 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
window.requestAnimationFrame(function() {
chrome.send('loginVisible', ['gaia-loading']);
});
+ $('back-button-item').disabled = false;
+ $('back-button-item').hidden = true;
$('close-button-item').disabled = false;
this.classList.toggle('loading', this.loading);
@@ -465,6 +474,7 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
* @private
*/
onDialogShown_: function() {
+ $('back-button-item').disabled = true;
$('close-button-item').disabled = true;
},
@@ -473,10 +483,19 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
* @private
*/
onDialogHidden_: function() {
+ $('back-button-item').disabled = false;
$('close-button-item').disabled = false;
},
/**
+ * Invoked when the auth host emits 'backButton' event.
+ * @private
+ */
+ onBackButton_: function(e) {
+ $('back-button-item').hidden = !e.detail;
+ },
+
+ /**
* Invoked when the user has successfully authenticated via SAML, the
* principals API was not used and the auth host needs the user to confirm
* the scraped password.

Powered by Google App Engine
This is Rietveld 408576698