summaryrefslogtreecommitdiffstats
path: root/extensions/renderer/script_injection.h
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2014-09-23 21:30:56 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-24 04:31:08 +0000
commit2e44917894a92a0d6fb0e56e3220811f811d1c8e (patch)
treec1ab6fa48ba41d9f2d27a11907105f618c0bbf20 /extensions/renderer/script_injection.h
parent5e4a92f923982405e20195e9de9f675c41e0748c (diff)
downloadchromium_src-2e44917894a92a0d6fb0e56e3220811f811d1c8e.zip
chromium_src-2e44917894a92a0d6fb0e56e3220811f811d1c8e.tar.gz
chromium_src-2e44917894a92a0d6fb0e56e3220811f811d1c8e.tar.bz2
Change ScriptInjection to work with WebLocalFrames.
This is to help unblock some of the Blink work to move local frame only APIs off WebFrame. Strictly speaking, all that was required to unblock this bug was to manually coerce the WebFrame to a WebLocalFrame for the call to setIsolatedWorldHumanReadableName. However, it never makes sense to inject script on a remote frame, so I've updated ScriptInjection to just work with local frames where possible. Code that uses ScriptInjection now does the type coercion at the class boundary. As extensions code is gradually updated to understand out-of-process iframes, these manual type coercions should disappear. BUG=416659 Review URL: https://codereview.chromium.org/594043002 Cr-Commit-Position: refs/heads/master@{#296345}
Diffstat (limited to 'extensions/renderer/script_injection.h')
-rw-r--r--extensions/renderer/script_injection.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/extensions/renderer/script_injection.h b/extensions/renderer/script_injection.h
index 42ecdbd..d7edd66 100644
--- a/extensions/renderer/script_injection.h
+++ b/extensions/renderer/script_injection.h
@@ -11,7 +11,7 @@
#include "extensions/renderer/script_injector.h"
namespace blink {
-class WebFrame;
+class WebLocalFrame;
}
namespace extensions {
@@ -29,7 +29,7 @@ class ScriptInjection {
static void RemoveIsolatedWorld(const std::string& extension_id);
ScriptInjection(scoped_ptr<ScriptInjector> injector,
- blink::WebFrame* web_frame,
+ blink::WebLocalFrame* web_frame,
const std::string& extension_id,
UserScript::RunLocation run_location,
int tab_id);
@@ -50,7 +50,7 @@ class ScriptInjection {
ScriptsRunInfo* scripts_run_info);
// Accessors.
- blink::WebFrame* web_frame() const { return web_frame_; }
+ blink::WebLocalFrame* web_frame() const { return web_frame_; }
const std::string& extension_id() const { return extension_id_; }
int64 request_id() const { return request_id_; }
@@ -64,11 +64,11 @@ class ScriptInjection {
// Inject any JS scripts into the |frame|, optionally populating
// |execution_results|.
void InjectJs(const Extension* extension,
- blink::WebFrame* frame,
+ blink::WebLocalFrame* frame,
base::ListValue* execution_results);
// Inject any CSS source into the |frame|.
- void InjectCss(blink::WebFrame* frame);
+ void InjectCss(blink::WebLocalFrame* frame);
// Notify that we will not inject, and mark it as acknowledged.
void NotifyWillNotInject(ScriptInjector::InjectFailureReason reason);
@@ -77,7 +77,7 @@ class ScriptInjection {
scoped_ptr<ScriptInjector> injector_;
// The (main) WebFrame into which this should inject the script.
- blink::WebFrame* web_frame_;
+ blink::WebLocalFrame* web_frame_;
// The id of the associated extension.
std::string extension_id_;