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

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

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android compilation Created 7 years, 9 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/file_browser_private_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/file_browser_private_custom_bindings.js b/chrome/renderer/resources/extensions/file_browser_private_custom_bindings.js
index 0d9369dcea65c0691beb9b4e41968f3d12803d5f..10c616e95eae418dade40afc161fbc0ab637c4fa 100644
--- a/chrome/renderer/resources/extensions/file_browser_private_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/file_browser_private_custom_bindings.js
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Custom bindings for the fileBrowserPrivate API.
+// Custom binding for the fileBrowserPrivate API.
+
+var binding = require('binding').Binding.create('fileBrowserPrivate');
var fileBrowserPrivateNatives = requireNative('file_browser_private');
var GetLocalFileSystem = fileBrowserPrivateNatives.GetLocalFileSystem;
@@ -10,9 +12,7 @@ var GetLocalFileSystem = fileBrowserPrivateNatives.GetLocalFileSystem;
var fileBrowserNatives = requireNative('file_browser_handler');
var GetExternalFileEntry = fileBrowserNatives.GetExternalFileEntry;
-var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
-
-chromeHidden.registerCustomHook('fileBrowserPrivate', function(bindingsAPI) {
+binding.registerCustomHook(function(bindingsAPI) {
var apiFunctions = bindingsAPI.apiFunctions;
apiFunctions.setCustomCallback('requestLocalFileSystem',
@@ -61,3 +61,5 @@ chromeHidden.registerCustomHook('fileBrowserPrivate', function(bindingsAPI) {
request.callback = null;
});
});
+
+exports.binding = binding.generate();

Powered by Google App Engine
This is Rietveld 408576698