summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/script_executor_impl.cc
diff options
context:
space:
mode:
authoreaugusti@chromium.org <eaugusti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-25 23:34:31 +0000
committereaugusti@chromium.org <eaugusti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-25 23:34:31 +0000
commit771baf0c6d0a97c3a10eb6448c2161daf351fb40 (patch)
treee95f17214e578748cc5a99bfdae5a67d8b6052d1 /chrome/browser/extensions/script_executor_impl.cc
parentf6f72fb8adde6f5c901fd887e275831df8de3b58 (diff)
downloadchromium_src-771baf0c6d0a97c3a10eb6448c2161daf351fb40.zip
chromium_src-771baf0c6d0a97c3a10eb6448c2161daf351fb40.tar.gz
chromium_src-771baf0c6d0a97c3a10eb6448c2161daf351fb40.tar.bz2
Uses the result of injected js as an optional parameter to an optional callback.
This feature requires changes to WebKitt. The diff for these changes are here: https://gist.github.com/1732015 BUG=22349 Review URL: https://chromiumcodereview.appspot.com/9325032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144055 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/script_executor_impl.cc')
-rw-r--r--chrome/browser/extensions/script_executor_impl.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/chrome/browser/extensions/script_executor_impl.cc b/chrome/browser/extensions/script_executor_impl.cc
index e8f6199..ae8c251 100644
--- a/chrome/browser/extensions/script_executor_impl.cc
+++ b/chrome/browser/extensions/script_executor_impl.cc
@@ -14,6 +14,10 @@
#include "ipc/ipc_message.h"
#include "ipc/ipc_message_macros.h"
+namespace base {
+class ListValue;
+} // namespace base
+
namespace extensions {
namespace {
@@ -58,7 +62,8 @@ class Handler : public content::WebContentsObserver {
}
virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE {
- callback_.Run(false, -1, kRendererDestroyed);
+ base::ListValue val;
+ callback_.Run(false, -1, kRendererDestroyed, val);
delete this;
}
@@ -66,8 +71,9 @@ class Handler : public content::WebContentsObserver {
void OnExecuteCodeFinished(int request_id,
bool success,
int32 page_id,
- const std::string& error) {
- callback_.Run(success, page_id, error);
+ const std::string& error,
+ const base::ListValue& script_result) {
+ callback_.Run(success, page_id, error, script_result);
delete this;
}
@@ -98,7 +104,7 @@ void ScriptExecutorImpl::ExecuteScript(
params.is_javascript = (script_type == JAVASCRIPT);
params.code = code;
params.all_frames = (frame_scope == ALL_FRAMES);
- params.run_at = (int) run_at;
+ params.run_at = static_cast<int>(run_at);
params.in_main_world = (world_type == MAIN_WORLD);
// Handler handles IPCs and deletes itself on completion.