Index: chrome/renderer/resources/extensions/enterprise_certificates_internal_custom_bindings.js |
diff --git a/chrome/renderer/resources/extensions/enterprise_certificates_internal_custom_bindings.js b/chrome/renderer/resources/extensions/enterprise_certificates_internal_custom_bindings.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7965b8342858ee7e92171df296ff0fac2f1942ca |
--- /dev/null |
+++ b/chrome/renderer/resources/extensions/enterprise_certificates_internal_custom_bindings.js |
@@ -0,0 +1,25 @@ |
+// Copyright 2014 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 enterprise.certificatesInternal API. |
+ |
+var binding = |
+ require('binding').Binding.create('enterprise.certificatesInternal'); |
+var importNative = |
+ requireNative('enterprise_certificates_natives').ImportNative; |
+var sendRequest = require('sendRequest').sendRequest; |
+ |
+binding.registerCustomHook(function(api) { |
+ var apiFunctions = api.apiFunctions; |
+ |
+ apiFunctions.setHandleRequest('importClientCertificateAndWebCryptoKey', |
+ function(key, cert, tokenName, callback) { |
+ sendRequest('' /* functionName unused */, |
+ [key, cert, tokenName, callback], |
+ this.definition.parameters, |
+ {nativeFunction: importNative}); |
+ }); |
+}); |
+ |
+exports.binding = binding.generate(); |