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

Unified Diff: components/plugins/renderer/webview_plugin.cc

Issue 2923433002: Move ExecuteScript method from WebFrame to WebLocalFrame. (Closed)
Patch Set: Tweaked a comment in WebViewPlugin::WebViewHelper::main_frame [as suggested in CR feedback] Created 3 years, 6 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 | « components/plugins/renderer/webview_plugin.h ('k') | components/printing/renderer/print_web_view_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/plugins/renderer/webview_plugin.cc
diff --git a/components/plugins/renderer/webview_plugin.cc b/components/plugins/renderer/webview_plugin.cc
index 80404cfe8a37bf45a2894bf8631a452680cf3fef..b5da7d5f7011650d25c85bf8d6d818df512926f8 100644
--- a/components/plugins/renderer/webview_plugin.cc
+++ b/components/plugins/renderer/webview_plugin.cc
@@ -68,7 +68,7 @@ WebViewPlugin* WebViewPlugin::Create(content::RenderView* render_view,
const GURL& url) {
DCHECK(url.is_valid()) << "Blink requires the WebView to have a valid URL.";
WebViewPlugin* plugin = new WebViewPlugin(render_view, delegate, preferences);
- plugin->web_view()->MainFrame()->LoadHTMLString(html_data, url);
+ plugin->main_frame()->LoadHTMLString(html_data, url);
return plugin;
}
@@ -271,6 +271,13 @@ WebViewPlugin::WebViewHelper::~WebViewHelper() {
web_view_->Close();
}
+blink::WebLocalFrame* WebViewPlugin::WebViewHelper::main_frame() {
+ // WebViewHelper doesn't support OOPIFs so the main frame will
+ // always be local.
+ DCHECK(web_view_->MainFrame()->IsWebLocalFrame());
+ return static_cast<WebLocalFrame*>(web_view_->MainFrame());
+}
+
bool WebViewPlugin::WebViewHelper::AcceptsLoadDrops() {
return false;
}
@@ -296,11 +303,7 @@ void WebViewPlugin::WebViewHelper::StartDragging(blink::WebReferrerPolicy,
const WebImage&,
const WebPoint&) {
// Immediately stop dragging.
- DCHECK(web_view_->MainFrame()->IsWebLocalFrame());
- web_view_->MainFrame()
- ->ToWebLocalFrame()
- ->FrameWidget()
- ->DragSourceSystemDragEnded();
+ main_frame()->FrameWidget()->DragSourceSystemDragEnded();
}
bool WebViewPlugin::WebViewHelper::AllowsBrokenNullLayerTreeView() const {
@@ -345,8 +348,7 @@ void WebViewPlugin::WebViewHelper::DidClearWindowObject() {
v8::Isolate* isolate = blink::MainThreadIsolate();
v8::HandleScope handle_scope(isolate);
- v8::Local<v8::Context> context =
- web_view_->MainFrame()->MainWorldScriptContext();
+ v8::Local<v8::Context> context = main_frame()->MainWorldScriptContext();
DCHECK(!context.IsEmpty());
v8::Context::Scope context_scope(context);
« no previous file with comments | « components/plugins/renderer/webview_plugin.h ('k') | components/printing/renderer/print_web_view_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698