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

Unified Diff: chrome/browser/resources/inline_login/inline_login.js

Issue 646983008: Implement signin using webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed nits and updated histogram Created 6 years, 2 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/inline_login/inline_login.js
diff --git a/chrome/browser/resources/inline_login/inline_login.js b/chrome/browser/resources/inline_login/inline_login.js
index 82ed0922e3901cb5189d3e1094a7eaac535ac2a8..fe41e0b1b937a3773efdbc53899b3c4932a42a7a 100644
--- a/chrome/browser/resources/inline_login/inline_login.js
+++ b/chrome/browser/resources/inline_login/inline_login.js
@@ -6,14 +6,12 @@
* @fileoverview Inline login UI.
*/
-<include src="../gaia_auth_host/gaia_auth_host.js">
-
cr.define('inline.login', function() {
'use strict';
/**
* The auth extension host instance.
- * @type {Object}
+ * @type {cr.login.GaiaAuthHost}
*/
var authExtHost;
@@ -23,6 +21,34 @@ cr.define('inline.login', function() {
var authReadyFired;
/**
+ * A listener class for authentication events from GaiaAuthHost.
+ * @constructor
+ * @implements {cr.login.GaiaAuthHost.Listener}
+ */
+ function GaiaAuthHostListener() {}
+
+ /** @override */
+ GaiaAuthHostListener.prototype.onSuccess = function(credentials) {
+ onAuthCompleted(credentials);
+ };
+
+ /** @override */
+ GaiaAuthHostListener.prototype.onReady = function(e) {
+ onAuthReady();
+ };
+
+ /** @override */
+ GaiaAuthHostListener.prototype.onResize = function(url) {
+ chrome.send('switchToFullTab', url);
+ };
+
+ /** @override */
+ GaiaAuthHostListener.prototype.onNewWindow = function(e) {
+ window.open(e.targetUrl, '_blank');
+ e.window.discard();
+ };
+
+ /**
* Handler of auth host 'ready' event.
*/
function onAuthReady() {
@@ -43,7 +69,8 @@ cr.define('inline.login', function() {
* Initialize the UI.
*/
function initialize() {
- authExtHost = new cr.login.GaiaAuthHost('signin-frame');
+ authExtHost = new cr.login.GaiaAuthHost(
+ 'signin-frame', new GaiaAuthHostListener());
authExtHost.addEventListener('ready', onAuthReady);
chrome.send('initialize');
« no previous file with comments | « chrome/browser/resources/inline_login/inline_login.html ('k') | chrome/browser/resources/inline_login/new_inline_login.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698