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

Unified Diff: chrome/browser/resources/gaia_auth_host/saml_handler.js

Issue 1966853002: Add indication of camera use on SAML webcam logins (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reset videoEnabled state when restarting auth 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
Index: chrome/browser/resources/gaia_auth_host/saml_handler.js
diff --git a/chrome/browser/resources/gaia_auth_host/saml_handler.js b/chrome/browser/resources/gaia_auth_host/saml_handler.js
index 89935284e6fbdd9f51dfe408df5c5ea334c1078f..cf7075b7d463d505f02f774bb5685ca199e4c724 100644
--- a/chrome/browser/resources/gaia_auth_host/saml_handler.js
+++ b/chrome/browser/resources/gaia_auth_host/saml_handler.js
@@ -148,13 +148,7 @@ cr.define('cr.login', function() {
this.webview_.addEventListener(
'loadcommit', this.onLoadCommit_.bind(this));
this.webview_.addEventListener(
- 'permissionrequest', function(e) {
- if (e.permission === 'media') {
- // The actual permission check happens in
- // WebUILoginView::RequestMediaAccessPermission().
- e.request.allow();
- }
- });
+ 'permissionrequest', this.onPermissionRequest_.bind(this));
this.webview_.request.onBeforeRequest.addListener(
this.onInsecureRequest.bind(this),
@@ -459,6 +453,15 @@ cr.define('cr.login', function() {
domain: this.authDomain}}));
},
+ onPermissionRequest_: function(permissionEvent) {
+ if (permissionEvent.permission === 'media') {
+ // The actual permission check happens in
+ // WebUILoginView::RequestMediaAccessPermission().
+ this.dispatchEvent(new CustomEvent('videoEnabled'));
+ permissionEvent.request.allow();
+ }
+ },
+
onGetSAMLFlag_: function(channel, msg) {
return this.isSamlPage_;
},

Powered by Google App Engine
This is Rietveld 408576698