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

Unified Diff: chrome/renderer/resources/extensions/tab_capture_custom_bindings.js

Issue 1221483002: New tabCapture.captureOffscreenTab API, initially for Presentation API 1UA mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/renderer/resources/extensions/tab_capture_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/tab_capture_custom_bindings.js b/chrome/renderer/resources/extensions/tab_capture_custom_bindings.js
index 93a60549e3743d366c47fabe14f7d8c63bff316d..ab16dfb60e3c0d877df04128050e8a1d77326366 100644
--- a/chrome/renderer/resources/extensions/tab_capture_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/tab_capture_custom_bindings.js
@@ -9,8 +9,7 @@ var binding = require('binding').Binding.create('tabCapture');
binding.registerCustomHook(function(bindingsAPI, extensionId) {
var apiFunctions = bindingsAPI.apiFunctions;
- apiFunctions.setCustomCallback('capture',
- function(name, request, callback, response) {
+ function proxyToGetUserMedia(name, request, callback, response) {
if (!callback)
return;
@@ -24,14 +23,17 @@ binding.registerCustomHook(function(bindingsAPI, extensionId) {
try {
navigator.webkitGetUserMedia(options,
function(stream) { callback(stream); },
- function() { callback(null); });
+ function(exception) { callback(null); });
} catch (e) {
callback(null);
}
} else {
callback(null);
}
- });
+ }
+
+ apiFunctions.setCustomCallback('capture', proxyToGetUserMedia);
+ apiFunctions.setCustomCallback('capturePresentation', proxyToGetUserMedia);
});
exports.binding = binding.generate();

Powered by Google App Engine
This is Rietveld 408576698