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

Unified Diff: chrome/renderer/resources/extensions/omnibox_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/omnibox_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/omnibox_custom_bindings.js b/chrome/renderer/resources/extensions/omnibox_custom_bindings.js
index 13a3c61a2f84b6385977d5ee51a6dedea4d7747e..37f8d92229357e394d7daebf33c448cb7473f2bb 100644
--- a/chrome/renderer/resources/extensions/omnibox_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/omnibox_custom_bindings.js
@@ -5,9 +5,7 @@
// Custom bindings for the omnibox API. Only injected into the v8 contexts
// for extensions which have permission for the omnibox API.
-(function() {
-
-native function GetChromeHidden();
+var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
// Remove invalid characters from |text| so that it is suitable to use
// for |AutocompleteMatch::contents|.
@@ -79,7 +77,7 @@ function parseOmniboxDescription(input) {
return result;
}
-GetChromeHidden().registerCustomHook('omnibox', function(bindingsAPI) {
+chromeHidden.registerCustomHook('omnibox', function(bindingsAPI) {
var apiFunctions = bindingsAPI.apiFunctions;
var sendRequest = bindingsAPI.sendRequest;
@@ -108,5 +106,3 @@ GetChromeHidden().registerCustomHook('omnibox', function(bindingsAPI) {
chrome.Event.prototype.dispatch.apply(this, [text, suggestCallback]);
};
});
-
-})();

Powered by Google App Engine
This is Rietveld 408576698