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

Unified Diff: extensions/renderer/script_injection_manager.cc

Issue 594043002: Change ScriptInjection to work with WebLocalFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « extensions/renderer/script_injection.cc ('k') | extensions/renderer/user_script_set.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/script_injection_manager.cc
diff --git a/extensions/renderer/script_injection_manager.cc b/extensions/renderer/script_injection_manager.cc
index 14f276746aab2daf65891de3c1e916d4d280d23a..abd7d80cd82ad9077009c16b4eb3d7fa75034b98 100644
--- a/extensions/renderer/script_injection_manager.cc
+++ b/extensions/renderer/script_injection_manager.cc
@@ -321,7 +321,11 @@ void ScriptInjectionManager::InjectScripts(
void ScriptInjectionManager::HandleExecuteCode(
const ExtensionMsg_ExecuteCode_Params& params,
content::RenderView* render_view) {
- blink::WebFrame* main_frame = render_view->GetWebView()->mainFrame();
+ // TODO(dcheng): Not sure how this can happen today. In an OOPI world, it
+ // would indicate a logic error--the browser must direct this request to the
+ // right renderer process to begin with.
+ blink::WebLocalFrame* main_frame =
+ render_view->GetWebView()->mainFrame()->toWebLocalFrame();
if (!main_frame) {
render_view->Send(
new ExtensionHostMsg_ExecuteCodeFinished(render_view->GetRoutingID(),
@@ -357,10 +361,12 @@ void ScriptInjectionManager::HandleExecuteDeclarativeScript(
int script_id,
const GURL& url) {
const Extension* extension = extensions_->GetByID(extension_id);
+ // TODO(dcheng): This function signature should really be a WebLocalFrame,
+ // rather than trying to coerce it here.
scoped_ptr<ScriptInjection> injection =
user_script_set_manager_->GetInjectionForDeclarativeScript(
script_id,
- web_frame,
+ web_frame->toWebLocalFrame(),
tab_id,
url,
extension);
« no previous file with comments | « extensions/renderer/script_injection.cc ('k') | extensions/renderer/user_script_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698