| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/renderer/extensions/dispatcher.h" | 5 #include "chrome/renderer/extensions/dispatcher.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 source_map_.RegisterSource("utils", IDR_UTILS_JS); | 782 source_map_.RegisterSource("utils", IDR_UTILS_JS); |
| 783 source_map_.RegisterSource("entryIdManager", IDR_ENTRY_ID_MANAGER); | 783 source_map_.RegisterSource("entryIdManager", IDR_ENTRY_ID_MANAGER); |
| 784 | 784 |
| 785 // Custom bindings. | 785 // Custom bindings. |
| 786 source_map_.RegisterSource("app", IDR_APP_CUSTOM_BINDINGS_JS); | 786 source_map_.RegisterSource("app", IDR_APP_CUSTOM_BINDINGS_JS); |
| 787 source_map_.RegisterSource("app.runtime", IDR_APP_RUNTIME_CUSTOM_BINDINGS_JS); | 787 source_map_.RegisterSource("app.runtime", IDR_APP_RUNTIME_CUSTOM_BINDINGS_JS); |
| 788 source_map_.RegisterSource("app.window", IDR_APP_WINDOW_CUSTOM_BINDINGS_JS); | 788 source_map_.RegisterSource("app.window", IDR_APP_WINDOW_CUSTOM_BINDINGS_JS); |
| 789 source_map_.RegisterSource("bluetooth", IDR_BLUETOOTH_CUSTOM_BINDINGS_JS); | 789 source_map_.RegisterSource("bluetooth", IDR_BLUETOOTH_CUSTOM_BINDINGS_JS); |
| 790 source_map_.RegisterSource("browserAction", | 790 source_map_.RegisterSource("browserAction", |
| 791 IDR_BROWSER_ACTION_CUSTOM_BINDINGS_JS); | 791 IDR_BROWSER_ACTION_CUSTOM_BINDINGS_JS); |
| 792 source_map_.RegisterSource("contentSettings", | |
| 793 IDR_CONTENT_SETTINGS_CUSTOM_BINDINGS_JS); | |
| 794 source_map_.RegisterSource("contextMenus", | 792 source_map_.RegisterSource("contextMenus", |
| 795 IDR_CONTEXT_MENUS_CUSTOM_BINDINGS_JS); | 793 IDR_CONTEXT_MENUS_CUSTOM_BINDINGS_JS); |
| 796 source_map_.RegisterSource("declarativeContent", | 794 source_map_.RegisterSource("declarativeContent", |
| 797 IDR_DECLARATIVE_CONTENT_CUSTOM_BINDINGS_JS); | 795 IDR_DECLARATIVE_CONTENT_CUSTOM_BINDINGS_JS); |
| 798 source_map_.RegisterSource("declarativeWebRequest", | 796 source_map_.RegisterSource("declarativeWebRequest", |
| 799 IDR_DECLARATIVE_WEBREQUEST_CUSTOM_BINDINGS_JS); | 797 IDR_DECLARATIVE_WEBREQUEST_CUSTOM_BINDINGS_JS); |
| 800 source_map_.RegisterSource("downloads", | 798 source_map_.RegisterSource("downloads", |
| 801 IDR_DOWNLOADS_CUSTOM_BINDINGS_JS); | 799 IDR_DOWNLOADS_CUSTOM_BINDINGS_JS); |
| 802 source_map_.RegisterSource( | 800 source_map_.RegisterSource( |
| 803 "experimental.mediaGalleries", | 801 "experimental.mediaGalleries", |
| (...skipping 14 matching lines...) Expand all Loading... |
| 818 source_map_.RegisterSource("notifications", | 816 source_map_.RegisterSource("notifications", |
| 819 IDR_NOTIFICATIONS_CUSTOM_BINDINGS_JS); | 817 IDR_NOTIFICATIONS_CUSTOM_BINDINGS_JS); |
| 820 source_map_.RegisterSource("omnibox", IDR_OMNIBOX_CUSTOM_BINDINGS_JS); | 818 source_map_.RegisterSource("omnibox", IDR_OMNIBOX_CUSTOM_BINDINGS_JS); |
| 821 source_map_.RegisterSource("pageActions", | 819 source_map_.RegisterSource("pageActions", |
| 822 IDR_PAGE_ACTIONS_CUSTOM_BINDINGS_JS); | 820 IDR_PAGE_ACTIONS_CUSTOM_BINDINGS_JS); |
| 823 source_map_.RegisterSource("pageAction", IDR_PAGE_ACTION_CUSTOM_BINDINGS_JS); | 821 source_map_.RegisterSource("pageAction", IDR_PAGE_ACTION_CUSTOM_BINDINGS_JS); |
| 824 source_map_.RegisterSource("pageCapture", | 822 source_map_.RegisterSource("pageCapture", |
| 825 IDR_PAGE_CAPTURE_CUSTOM_BINDINGS_JS); | 823 IDR_PAGE_CAPTURE_CUSTOM_BINDINGS_JS); |
| 826 source_map_.RegisterSource("permissions", IDR_PERMISSIONS_CUSTOM_BINDINGS_JS); | 824 source_map_.RegisterSource("permissions", IDR_PERMISSIONS_CUSTOM_BINDINGS_JS); |
| 827 source_map_.RegisterSource("runtime", IDR_RUNTIME_CUSTOM_BINDINGS_JS); | 825 source_map_.RegisterSource("runtime", IDR_RUNTIME_CUSTOM_BINDINGS_JS); |
| 828 source_map_.RegisterSource("storage", IDR_STORAGE_CUSTOM_BINDINGS_JS); | |
| 829 source_map_.RegisterSource("syncFileSystem", | 826 source_map_.RegisterSource("syncFileSystem", |
| 830 IDR_SYNC_FILE_SYSTEM_CUSTOM_BINDINGS_JS); | 827 IDR_SYNC_FILE_SYSTEM_CUSTOM_BINDINGS_JS); |
| 831 source_map_.RegisterSource("systemIndicator", | 828 source_map_.RegisterSource("systemIndicator", |
| 832 IDR_SYSTEM_INDICATOR_CUSTOM_BINDINGS_JS); | 829 IDR_SYSTEM_INDICATOR_CUSTOM_BINDINGS_JS); |
| 833 source_map_.RegisterSource("tabCapture", IDR_TAB_CAPTURE_CUSTOM_BINDINGS_JS); | 830 source_map_.RegisterSource("tabCapture", IDR_TAB_CAPTURE_CUSTOM_BINDINGS_JS); |
| 834 source_map_.RegisterSource("tabs", IDR_TABS_CUSTOM_BINDINGS_JS); | 831 source_map_.RegisterSource("tabs", IDR_TABS_CUSTOM_BINDINGS_JS); |
| 835 source_map_.RegisterSource("tts", IDR_TTS_CUSTOM_BINDINGS_JS); | 832 source_map_.RegisterSource("tts", IDR_TTS_CUSTOM_BINDINGS_JS); |
| 836 source_map_.RegisterSource("ttsEngine", IDR_TTS_ENGINE_CUSTOM_BINDINGS_JS); | 833 source_map_.RegisterSource("ttsEngine", IDR_TTS_ENGINE_CUSTOM_BINDINGS_JS); |
| 837 source_map_.RegisterSource("types", IDR_TYPES_CUSTOM_BINDINGS_JS); | |
| 838 source_map_.RegisterSource("webRequest", IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS); | 834 source_map_.RegisterSource("webRequest", IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS); |
| 839 source_map_.RegisterSource("webRequestInternal", | 835 source_map_.RegisterSource("webRequestInternal", |
| 840 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS); | 836 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS); |
| 841 source_map_.RegisterSource("webstore", IDR_WEBSTORE_CUSTOM_BINDINGS_JS); | 837 source_map_.RegisterSource("webstore", IDR_WEBSTORE_CUSTOM_BINDINGS_JS); |
| 842 source_map_.RegisterSource("binding", IDR_BINDING_JS); | 838 source_map_.RegisterSource("binding", IDR_BINDING_JS); |
| 843 | 839 |
| 840 // Custom types sources. |
| 841 source_map_.RegisterSource("ChromeSetting", IDR_CHROME_SETTING_JS); |
| 842 source_map_.RegisterSource("StorageArea", IDR_STORAGE_AREA_JS); |
| 843 source_map_.RegisterSource("ContentSetting", IDR_CONTENT_SETTING_JS); |
| 844 |
| 844 // Platform app sources that are not API-specific.. | 845 // Platform app sources that are not API-specific.. |
| 845 source_map_.RegisterSource("tagWatcher", IDR_TAG_WATCHER_JS); | 846 source_map_.RegisterSource("tagWatcher", IDR_TAG_WATCHER_JS); |
| 846 // Note: webView not webview so that this doesn't interfere with the | 847 // Note: webView not webview so that this doesn't interfere with the |
| 847 // chrome.webview API bindings. | 848 // chrome.webview API bindings. |
| 848 source_map_.RegisterSource("webView", IDR_WEB_VIEW_JS); | 849 source_map_.RegisterSource("webView", IDR_WEB_VIEW_JS); |
| 849 source_map_.RegisterSource("webViewExperimental", | 850 source_map_.RegisterSource("webViewExperimental", |
| 850 IDR_WEB_VIEW_EXPERIMENTAL_JS); | 851 IDR_WEB_VIEW_EXPERIMENTAL_JS); |
| 851 source_map_.RegisterSource("denyWebView", IDR_WEB_VIEW_DENY_JS); | 852 source_map_.RegisterSource("denyWebView", IDR_WEB_VIEW_DENY_JS); |
| 852 source_map_.RegisterSource("platformApp", IDR_PLATFORM_APP_JS); | 853 source_map_.RegisterSource("platformApp", IDR_PLATFORM_APP_JS); |
| 853 source_map_.RegisterSource("injectAppTitlebar", IDR_INJECT_APP_TITLEBAR_JS); | 854 source_map_.RegisterSource("injectAppTitlebar", IDR_INJECT_APP_TITLEBAR_JS); |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1326 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); | 1327 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); |
| 1327 v8::ThrowException( | 1328 v8::ThrowException( |
| 1328 v8::Exception::Error(v8::String::New(error_msg.c_str()))); | 1329 v8::Exception::Error(v8::String::New(error_msg.c_str()))); |
| 1329 return false; | 1330 return false; |
| 1330 } | 1331 } |
| 1331 | 1332 |
| 1332 return true; | 1333 return true; |
| 1333 } | 1334 } |
| 1334 | 1335 |
| 1335 } // namespace extensions | 1336 } // namespace extensions |
| OLD | NEW |