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

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

Issue 1063753004: Use HTML messages to inform GAIA about deviceId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 9e1bfef194313d66ad2abe023e6124410bcd3ffb..bdc8e336a911d8956a60f7170c08d2a0d6e89733 100644
--- a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
+++ b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
@@ -27,7 +27,8 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
'onWebviewError',
'onFrameError',
'updateCancelButtonState',
- 'showWhitelistCheckFailedError'
+ 'showWhitelistCheckFailedError',
+ 'updateDeviceId',
],
/**
@@ -131,6 +132,8 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
'backButton', this.onBackButton_.bind(this));
this.gaiaAuthHost_.addEventListener(
'showView', this.onShowView_.bind(this));
+ this.gaiaAuthHost_.addEventListener('attemptLogin',
+ this.onAttemptLogin_.bind(this));
this.gaiaAuthHost_.confirmPasswordCallback =
this.onAuthConfirmPassword_.bind(this);
this.gaiaAuthHost_.noPasswordCallback =
@@ -547,6 +550,14 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
},
/**
+ * Invoked when the auth host emits 'attemptLogin' event.
Nikita (slow) 2015/04/22 16:51:52 nit: Add information about parameter.
Alexander Alekseev 2015/04/22 17:58:07 Done.
+ * @private
+ */
+ onAttemptLogin_: function(e) {
+ chrome.send('attemptLogin', [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.
@@ -856,5 +867,17 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
if (!show)
Oobe.showSigninUI();
},
+
+ /**
+ * Inform Gaia of new deviceId.
+ * @param {data} Object like {'deviceId': 'test-device-id'}
+ */
+ updateDeviceId: function(data) {
+ if (!this.isNewGaiaFlow)
+ return;
+
+ if (data && data.deviceId)
+ this.gaiaAuthHost_.updateDeviceId(data.deviceId);
+ },
};
});

Powered by Google App Engine
This is Rietveld 408576698