Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / resources / gaia_auth_host / gaia_auth_host.js
index a7dadc9..e835e20 100644 (file)
@@ -173,6 +173,11 @@ cr.define('cr.login', function() {
     noPasswordCallback_: null,
 
     /**
+     * Invoked when the authentication flow had to be aborted because content
+     * served over an unencrypted connection was detected.
+    insecureContentBlockedCallback_: null,
+
+    /**
      * The iframe container.
      * @type {HTMLIFrameElement}
      */
@@ -205,6 +210,14 @@ cr.define('cr.login', function() {
     },
 
     /**
+     * Sets insecureContentBlockedCallback_.
+     * @type {function(string)}
+     */
+    set insecureContentBlockedCallback(callback) {
+      this.insecureContentBlockedCallback_ = callback;
+    },
+
+    /**
      * Loads the auth extension.
      * @param {AuthMode} authMode Authorization mode.
      * @param {Object} data Parameters for the auth extension. See the auth
@@ -374,6 +387,16 @@ cr.define('cr.login', function() {
         return;
       }
 
+      if (msg.method == 'insecureContentBlocked') {
+        if (this.insecureContentBlockedCallback_) {
+          this.insecureContentBlockedCallback_(msg.url);
+        } else {
+          console.error(
+              'GaiaAuthHost: Invalid insecureContentBlockedCallback_.');
+        }
+        return;
+      }
+
       if (msg.method == 'switchToFullTab') {
         chrome.send('switchToFullTab', [msg.url]);
         return;