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..f4381f16efee371d2cd6437dabfb8db9f30ecd2d 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 = |
@@ -362,7 +365,7 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { |
params.chromeType = data.chromeType; |
params.isNewGaiaFlowChromeOS = true; |
$('login-header-bar').showGuestButton = true; |
- this.gaiaAuthHost_.setDeviceId(data.deviceId); |
+ params.deviceId = data.deviceId; |
} |
if (data.gaiaEndpoint) |
@@ -547,6 +550,16 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { |
}, |
/** |
+ * Invoked when the auth host emits 'attemptLogin' event. |
+ * @param {Object} Message object with |detail| field keeping email: |
+ * like {detail: 'user@gmail.com'} . |
+ * @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 +869,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); |
+ }, |
}; |
}); |