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

Unified Diff: chrome/renderer/resources/extension_process_bindings.js

Issue 159067: Add API: getBackgroundPageView and getToolstripViews (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 4 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/extension_process_bindings.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extension_process_bindings.js
===================================================================
--- chrome/renderer/resources/extension_process_bindings.js (revision 24584)
+++ chrome/renderer/resources/extension_process_bindings.js (working copy)
@@ -19,6 +19,8 @@
native function GetChromeHidden();
native function GetNextRequestId();
native function OpenChannelToTab();
+ native function ExecuteScript();
+ native function ExecuteScriptWithUrl();
if (!chrome)
chrome = {};
@@ -281,6 +283,21 @@
return GetExtensionViews(windowId, "TAB");
}
+ apiFunctions["extension.executeScriptCode"].handleRequest =
+ function(scriptCode) {
+ return ExecuteScript(scriptCode);
+ }
+
+ apiFunctions["extension.executeScriptWithUrl"].handleRequest =
+ function(scriptUrl) {
+ var requestId = GetNextRequestId();
+ var executeScriptCodeCallback = function(scriptCode) {
+ return ExecuteScript(scriptCode);
+ }
+ callbacks[requestId] = executeScriptCodeCallback;
+ return ExecuteScriptWithUrl(requestId, JSON.stringify(scriptUrl));
+ }
+
apiFunctions["devtools.getTabEvents"].handleRequest = function(tabId) {
var tabIdProxy = {};
forEach(["onPageEvent", "onTabUrlChange", "onTabClose"],
« no previous file with comments | « chrome/renderer/extensions/extension_process_bindings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698