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

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

Issue 1983433002: Add timeout for SAML webcam logins (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@saml-ui
Patch Set: cancel timer if login is aborted Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4c60e44b4aca827fd883bf3c6446e6444c260618..32acabac73edf36a575cb28e272d71ce8cd7fc2e 100644
--- a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
+++ b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
@@ -27,6 +27,11 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
// online.
/** @const */ var IDLE_TIME_CHECK_FREQUENCY = 5 * 1000;
+ // Amount of time allowed for video based SAML logins, to prevent a site
+ // from keeping the camera on indefinitely. This is a hard deadline and
+ // it will not be extended by user activity.
+ /** @const */ var MAX_VIDEO_LOGIN_TIME_SEC = 60;
achuithb 2016/05/17 21:49:32 Just make this in millisec: var VIDEO_LOGIN_TIMEOU
Kevin Cernekee 2016/05/17 21:56:10 Done.
+
/**
* The modes this screen can be in.
* @enum {integer}
@@ -82,6 +87,13 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
loadAnimationGuardTimer_: undefined,
/**
+ * Timer id of the video login timer.
+ * @type {number}
+ * @private
+ */
+ videoTimer_: undefined,
+
+ /**
* Whether we've processed 'showView' message - either from GAIA or from
* guard timer.
* @type {boolean}
@@ -635,6 +647,10 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
*/
onVideoEnabledChange_: function() {
this.updateSamlNotice_();
+ if (this.gaiaAuthHost_.videoEnabled && this.videoTimer_ === undefined) {
+ this.videoTimer_ = setTimeout(this.cancel.bind(this),
+ MAX_VIDEO_LOGIN_TIME_SEC * 1000);
+ }
},
/**
@@ -951,6 +967,11 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
if (!this.navigation_.refreshVisible && !this.navigation_.closeVisible)
return;
+ if (this.videoTimer_ !== undefined) {
+ clearTimeout(this.videoTimer_);
+ this.videoTimer_ = undefined;
+ }
+
if (this.closable)
Oobe.showUserPods();
else
« 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