/** @const */ var HELP_TOPIC_ENTERPRISE_REPORTING = 2535613;
- /** @const */ var NET_ERROR_ABORTED = 3;
-
- /** @const */ var NET_ERROR_DISALLOWED_URL_SCHEME = 301;
-
return {
EXTERNAL_API: [
'loadAuthExtension',
this.onAuthConfirmPassword_.bind(this);
this.gaiaAuthHost_.noPasswordCallback =
this.onAuthNoPassword_.bind(this);
+ this.gaiaAuthHost_.insecureContentBlockedCallback =
+ this.onInsecureContentBlocked_.bind(this);
this.gaiaAuthHost_.addEventListener('authFlowChange',
this.onAuthFlowChange_.bind(this));
},
/**
+ * Invoked when the authentication flow had to be aborted because content
+ * served over an unencrypted connection was detected. Shows a fatal error.
+ * This method is only called on Chrome OS, where the entire authentication
+ * flow is required to be encrypted.
+ * @param {string} url The URL that was blocked.
+ */
+ onInsecureContentBlocked_: function(url) {
+ this.showFatalAuthError(loadTimeData.getStringF(
+ 'fatalErrorMessageInsecureURL',
+ url));
+ },
+
+ /**
* Shows the fatal auth error.
+ * @param {string} message The error message to show.
*/
- showFatalAuthError: function() {
- login.FatalErrorScreen.show(Oobe.showSigninUI);
+ showFatalAuthError: function(message) {
+ if (!message)
+ message = loadTimeData.getString('fatalErrorMessageGeneric');
+ login.FatalErrorScreen.show(message, Oobe.showSigninUI);
},
/**
* @param {string} url The URL that failed to load.
*/
onFrameError: function(error, url) {
- // Chrome OS requires that the entire authentication flow use https. If
- // GAIA attempts to redirect to an http URL, the load will be blocked by
- // CSP. Show a fatal error in this case.
- // Some tests deviate from the above by disabling the CSP and using a
- // mock GAIA implementation served over http. If an http URL fails to load
- // in such a test, it has nothing to do with CSP and should not cause a
- // fatal error to be shown.
- if (error == NET_ERROR_ABORTED &&
- url.indexOf('http://') == 0 &&
- this.gaiaAuthParams_.gaiaUrl.indexOf('https://') == 0) {
- error = NET_ERROR_DISALLOWED_URL_SCHEME;
- this.showFatalAuthError();
- }
this.error_ = error;
chrome.send('frameLoadingCompleted', [this.error_]);
},