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

Unified Diff: chrome/browser/resources/chromeos/login/screen_gaia_signin.js

Issue 789353004: Host Chrome OS GAIA signin page in webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed GAIA reload case Created 6 years 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/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 89e6671656c1e7f9258a06aed4b31464307b4673..ce0cd39a614f976c57e6d5a2f6470d590702c35d 100644
--- a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
+++ b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
@@ -6,8 +6,6 @@
* @fileoverview Oobe signin screen implementation.
*/
-<include src="../../gaia_auth_host/gaia_auth_host.js">
-
login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
// Gaia loading time after which error message must be displayed and
// lazy portal check should be fired.
@@ -89,9 +87,48 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
*/
samlPasswordConfirmAttempt_: 0,
+ /**
+ * Whether we should show webview based signin.
+ * @type {boolean}
+ * @private
+ */
+ isWebviewSignin: false,
+
/** @override */
decorate: function() {
- this.gaiaAuthHost_ = new cr.login.GaiaAuthHost($('signin-frame'));
+ this.isWebviewSignin = loadTimeData.getValue('isWebviewSignin');
+ if (this.isWebviewSignin) {
+ /**
+ * A listener class for authentication events from GaiaAuthHost.
+ * @constructor
+ * @implements {cr.login.GaiaAuthHost.Listener}
+ */
+ function GaiaAuthHostListener(gaia_screen) {
xiyuan 2014/12/26 23:06:02 Roger's recent CL is refactoring (https://coderevi
Dmitry Polukhin 2015/01/13 18:53:27 Done.
+ this.gaia_screen_ = gaia_screen;
+ }
+
+ /** @override */
+ GaiaAuthHostListener.prototype.onSuccess = function(credentials) {
+ this.gaia_screen_.onAuthCompleted_(credentials);
+ };
+
+ /** @override */
+ GaiaAuthHostListener.prototype.onReady = function(e) {
+ this.gaia_screen_.onAuthReady_();
+ };
+
+ // Replace iframe with webview.
+ var webview = this.ownerDocument.createElement('webview');
+ webview.id = 'signin-frame';
+ webview.name = 'signin-frame';
+ // TODO(dpolukhin): webview doesn't load page in hidden state,
+ // use curtain instead.
+ $('signin-frame').parentNode.replaceChild(webview, $('signin-frame'));
+ this.gaiaAuthHost_ = new cr.login.GaiaAuthHost(
+ webview, new GaiaAuthHostListener(this));
+ } else {
+ this.gaiaAuthHost_ = new cr.login.GaiaAuthHost($('signin-frame'));
+ }
this.gaiaAuthHost_.addEventListener(
'ready', this.onAuthReady_.bind(this));
this.gaiaAuthHost_.confirmPasswordCallback =
@@ -112,7 +149,6 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
e.preventDefault();
});
-
this.updateLocalizedContent();
},
@@ -148,7 +184,10 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
*/
showLoadingUI_: function(show) {
$('gaia-loading').hidden = !show;
- this.gaiaAuthHost_.frame.hidden = show;
+ if (!this.isWebviewSignin) {
+ // TODO(dpolukhin): proper implement curtain for webview signin.
+ this.gaiaAuthHost_.frame.hidden = show;
+ }
$('signin-right').hidden = show;
$('enterprise-info-container').hidden = show;
$('gaia-signin-divider').hidden = show;

Powered by Google App Engine
This is Rietveld 408576698