Index: extensions/renderer/resources/display_source_custom_bindings.js |
diff --git a/extensions/renderer/resources/display_source_custom_bindings.js b/extensions/renderer/resources/display_source_custom_bindings.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bc4820e856c437db50c09bc84c03a40d56662fd5 |
--- /dev/null |
+++ b/extensions/renderer/resources/display_source_custom_bindings.js |
@@ -0,0 +1,22 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Custom binding for the Display Source API. |
+ |
+var binding = require('binding').Binding.create('displaySource'); |
+var natives = requireNative('display_source'); |
+ |
+binding.registerCustomHook(function(bindingsAPI, extensionId) { |
+ var apiFunctions = bindingsAPI.apiFunctions; |
+ apiFunctions.setHandleRequest('startSession', |
+ function(sessionInfo) { |
+ natives.StartSession(sessionInfo); |
+ }); |
+ apiFunctions.setHandleRequest('terminateSession', |
+ function(session_id, callback) { |
+ natives.TerminateSession(session_id, callback); |
+ }); |
+}); |
+ |
+exports.binding = binding.generate(); |