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

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

Issue 875373002: First implementation of chrome.platformKeys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert_idl
Patch Set: Fix .gn file. Created 5 years, 10 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/platform_keys_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js b/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js
new file mode 100644
index 0000000000000000000000000000000000000000..c9eb65956994cbb80d7cf254eee766f26d365b4c
--- /dev/null
+++ b/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js
@@ -0,0 +1,24 @@
+// 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 platformKeys API.
+
+var binding = require('binding').Binding.create('platformKeys');
+var SubtleCrypto = require('platformKeys.SubtleCrypto').SubtleCrypto;
+var internalAPI = require('platformKeys.internalAPI');
+
+binding.registerCustomHook(function(api) {
+ var apiFunctions = api.apiFunctions;
+ var subtleCrypto = new SubtleCrypto('' /* tokenId */);
+
+ apiFunctions.setHandleRequest(
+ 'selectClientCertificates', function(details, callback) {
+ internalAPI.selectClientCertificates(details, callback);
+ });
+
+ apiFunctions.setHandleRequest(
+ 'subtleCrypto', function() { return subtleCrypto });
+});
+
+exports.binding = binding.generate();
« no previous file with comments | « chrome/renderer/resources/extensions/platform_keys/internal_api.js ('k') | chrome/renderer/resources/renderer_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698