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

Unified Diff: chrome/renderer/extensions/custom_bindings_util.cc

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
« no previous file with comments | « chrome/renderer/extensions/custom_bindings_util.h ('k') | chrome/renderer/extensions/event_bindings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/custom_bindings_util.cc
diff --git a/chrome/renderer/extensions/custom_bindings_util.cc b/chrome/renderer/extensions/custom_bindings_util.cc
index b9dfa8436e52346572975e7f8b9927b3c3a1ffea..5de0470b9fed8749f7eb3fe2312ea7d11fede4ca 100644
--- a/chrome/renderer/extensions/custom_bindings_util.cc
+++ b/chrome/renderer/extensions/custom_bindings_util.cc
@@ -31,83 +31,6 @@ namespace extensions {
namespace custom_bindings_util {
-std::vector<v8::Extension*> GetAll(ExtensionDispatcher* extension_dispatcher) {
- // Must match kResourceIDs.
- static const char* kJavascriptFiles[] = {
- "extensions/browser_action_custom_bindings.js",
- "extensions/content_settings_custom_bindings.js",
- "extensions/experimental.declarative_custom_bindings.js",
- "extensions/devtools_custom_bindings.js",
- "extensions/input.ime_custom_bindings.js",
- "extensions/omnibox_custom_bindings.js",
- "extensions/page_action_custom_bindings.js",
- "extensions/storage_custom_bindings.js",
- "extensions/tts_engine_custom_bindings.js",
- "extensions/types_custom_bindings.js",
- };
- static const size_t kJavascriptFilesSize = arraysize(kJavascriptFiles);
-
- // Must match kJavascriptFiles.
- static const int kResourceIDs[] = {
- IDR_BROWSER_ACTION_CUSTOM_BINDINGS_JS,
- IDR_CONTENT_SETTINGS_CUSTOM_BINDINGS_JS,
- IDR_EXPERIMENTAL_DECLARATIVE_CUSTOM_BINDINGS_JS,
- IDR_DEVTOOLS_CUSTOM_BINDINGS_JS,
- IDR_INPUT_IME_CUSTOM_BINDINGS_JS,
- IDR_OMNIBOX_CUSTOM_BINDINGS_JS,
- IDR_PAGE_ACTION_CUSTOM_BINDINGS_JS,
- IDR_STORAGE_CUSTOM_BINDINGS_JS,
- IDR_TTS_ENGINE_CUSTOM_BINDINGS_JS,
- IDR_TYPES_CUSTOM_BINDINGS_JS,
- };
- static const size_t kResourceIDsSize = arraysize(kResourceIDs);
-
- static const char* kDependencies[] = {
- "extensions/schema_generated_bindings.js",
- };
- static const size_t kDependencyCount = arraysize(kDependencies);
-
- std::vector<v8::Extension*> result;
-
- // Custom bindings that have native code parts.
- result.push_back(new ChromePrivateCustomBindings(
- kDependencyCount, kDependencies, extension_dispatcher));
- result.push_back(new ContextMenusCustomBindings(
- kDependencyCount, kDependencies));
- result.push_back(new ExtensionCustomBindings(
- kDependencyCount, kDependencies, extension_dispatcher));
- result.push_back(new ExperimentalSocketCustomBindings(
- kDependencyCount, kDependencies));
- result.push_back(new FileBrowserHandlerCustomBindings(
- kDependencyCount, kDependencies));
- result.push_back(new FileBrowserPrivateCustomBindings(
- kDependencyCount, kDependencies));
- result.push_back(new I18NCustomBindings(
- kDependencyCount, kDependencies));
- result.push_back(new PageActionsCustomBindings(
- kDependencyCount, kDependencies, extension_dispatcher));
- result.push_back(new PageCaptureCustomBindings(
- kDependencyCount, kDependencies));
- result.push_back(new TabsCustomBindings(
- kDependencyCount, kDependencies));
- result.push_back(new TTSCustomBindings(
- kDependencyCount, kDependencies));
- result.push_back(new WebRequestCustomBindings(
- kDependencyCount, kDependencies));
-
- // Pure JavaScript custom bindings.
- CHECK_EQ(kJavascriptFilesSize, kResourceIDsSize);
- for (size_t i = 0; i < kJavascriptFilesSize; ++i) {
- result.push_back(new ChromeV8Extension(
- kJavascriptFiles[i],
- kResourceIDs[i],
- kDependencyCount, kDependencies,
- NULL));
- }
-
- return result;
-}
-
// Extracts the name of an API from the name of the V8 extension which contains
// custom bindings for it (see kCustomBindingNames).
std::string GetAPIName(const std::string& v8_extension_name) {
« no previous file with comments | « chrome/renderer/extensions/custom_bindings_util.h ('k') | chrome/renderer/extensions/event_bindings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698