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

Side by Side Diff: chrome/browser/resources/gaia_auth_host/authenticator.js

Issue 943613002: ChromeOS Gaia: send message 'handshake' to Gaia to establish connection channel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview An UI component to authenciate to Chrome. The component hosts 6 * @fileoverview An UI component to authenciate to Chrome. The component hosts
7 * IdP web pages in a webview. A client who is interested in monitoring 7 * IdP web pages in a webview. A client who is interested in monitoring
8 * authentication events should pass a listener object of type 8 * authentication events should pass a listener object of type
9 * cr.login.GaiaAuthHost.Listener as defined in this file. After initialization, 9 * cr.login.GaiaAuthHost.Listener as defined in this file. After initialization,
10 * call {@code load} to start the authentication flow. 10 * call {@code load} to start the authentication flow.
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 }; 325 };
326 326
327 /** 327 /**
328 * Invoked when a new document is loaded. 328 * Invoked when a new document is loaded.
329 * @private 329 * @private
330 */ 330 */
331 Authenticator.prototype.onContentLoad_ = function(e) { 331 Authenticator.prototype.onContentLoad_ = function(e) {
332 // Posts a message to IdP pages to initiate communication. 332 // Posts a message to IdP pages to initiate communication.
333 var currentUrl = this.webview_.src; 333 var currentUrl = this.webview_.src;
334 if (currentUrl.lastIndexOf(this.idpOrigin_) == 0) { 334 if (currentUrl.lastIndexOf(this.idpOrigin_) == 0) {
335 this.webview_.contentWindow.postMessage({}, currentUrl); 335 var msg = {
336 'method': 'handshake'
337 };
338 this.webview_.contentWindow.postMessage(msg, currentUrl);
336 } 339 }
337 }; 340 };
338 341
339 /** 342 /**
340 * Invoked when the webview finishes loading a page. 343 * Invoked when the webview finishes loading a page.
341 * @private 344 * @private
342 */ 345 */
343 Authenticator.prototype.onLoadStop_ = function(e) { 346 Authenticator.prototype.onLoadStop_ = function(e) {
344 if (!this.loaded_) { 347 if (!this.loaded_) {
345 this.loaded_ = true; 348 this.loaded_ = true;
(...skipping 20 matching lines...) Expand all
366 Authenticator.AuthFlow = AuthFlow; 369 Authenticator.AuthFlow = AuthFlow;
367 Authenticator.AuthMode = AuthMode; 370 Authenticator.AuthMode = AuthMode;
368 Authenticator.SUPPORTED_PARAMS = SUPPORTED_PARAMS; 371 Authenticator.SUPPORTED_PARAMS = SUPPORTED_PARAMS;
369 372
370 return { 373 return {
371 // TODO(guohui, xiyuan): Rename GaiaAuthHost to Authenticator once the old 374 // TODO(guohui, xiyuan): Rename GaiaAuthHost to Authenticator once the old
372 // iframe-based flow is deprecated. 375 // iframe-based flow is deprecated.
373 GaiaAuthHost: Authenticator 376 GaiaAuthHost: Authenticator
374 }; 377 };
375 }); 378 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698