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

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

Issue 9386001: Implement a module system for the extension bindings JS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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/extension_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/extension_custom_bindings.js b/chrome/renderer/resources/extensions/extension_custom_bindings.js
index f746e2a4761a7f345cc30134435bcfc2f3e5952c..970e11f9ad24286b379e657737277aee15118618 100644
--- a/chrome/renderer/resources/extensions/extension_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/extension_custom_bindings.js
@@ -4,13 +4,11 @@
// Custom bindings for the extension API.
-(function() {
+var extensionNatives = requireNative('extension');
+var GetExtensionViews = extensionNatives.GetExtensionViews;
+var OpenChannelToExtension = extensionNatives.OpenChannelToExtension;
-native function GetChromeHidden();
-native function GetExtensionViews();
-native function OpenChannelToExtension(sourceId, targetId, name);
-
-var chromeHidden = GetChromeHidden();
+var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
// This should match chrome.windows.WINDOW_ID_NONE.
//
@@ -144,5 +142,3 @@ chromeHidden.registerCustomHook('extension',
throw new Error('Error connecting to extension ' + targetId);
});
});
-
-})();

Powered by Google App Engine
This is Rietveld 408576698