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

Unified Diff: chrome/renderer/render_view.cc

Issue 2827047: Make RenderView call the plugin through WebKit::WebPlugin (instead of casting... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: compile until webkit is rolled Created 10 years, 5 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/render_view.h ('k') | chrome/renderer/webplugin_delegate_pepper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 51864)
+++ chrome/renderer/render_view.cc (working copy)
@@ -1127,12 +1127,6 @@
if (!webview())
return;
- if (webview()->mainFrame()->document().isPluginDocument()) {
- webkit_glue::WebPluginDelegate* delegate = GetDelegateForPluginDocument();
- delegate->Copy();
- return;
- }
-
webview()->focusedFrame()->executeCommand(WebString::fromUTF8("Copy"));
UserMetricsRecordAction("Copy");
}
@@ -3486,10 +3480,8 @@
return url;
}
-webkit_glue::WebPluginDelegate* RenderView::GetDelegateForPluginDocument() {
- WebPlugin* plugin =
- webview()->mainFrame()->document().to<WebPluginDocument>().plugin();
- return static_cast<webkit_glue::WebPluginImpl*>(plugin)->delegate();
+WebKit::WebPlugin* RenderView::GetWebPluginFromPluginDocument() {
+ return webview()->mainFrame()->document().to<WebPluginDocument>().plugin();
}
void RenderView::OnFind(int request_id, const string16& search_text,
@@ -3497,19 +3489,19 @@
WebFrame* main_frame = webview()->mainFrame();
if (main_frame->document().isPluginDocument()) {
- webkit_glue::WebPluginDelegate* delegate = GetDelegateForPluginDocument();
+#if defined(WEBPLUGIN_HAS_FIND_INTERFACE)
if (options.findNext) {
// Just navigate back/forward.
- delegate->SelectFindResult(options.forward);
+ GetWebPluginFromPluginDocument()->selectFindResult(options.forward);
} else {
- if (delegate->SupportsFind()) {
- delegate->StartFind(UTF16ToUTF8(search_text),
- options.matchCase,
- request_id);
+ if (GetWebPluginFromPluginDocument()->supportsFind()) {
+ GetWebPluginFromPluginDocument()->startFind(
+ search_text, options.matchCase, request_id);
} else {
ReportNoFindInPageResults(request_id);
}
}
+#endif
return;
}
@@ -3622,7 +3614,9 @@
WebDocument doc = view->mainFrame()->document();
if (doc.isPluginDocument()) {
- GetDelegateForPluginDocument()->StopFind();
+#if defined(WEBPLUGIN_HAS_FIND_INTERFACE)
+ GetWebPluginFromPluginDocument()->stopFind();
+#endif
return;
}
@@ -3681,24 +3675,6 @@
return;
webview()->hidePopups();
- // Should we be saving zoom levels for plugins? It's not clear, so for now
- // don't.
- if (webview()->mainFrame()->document().isPluginDocument()) {
- webkit_glue::WebPluginDelegate* delegate = GetDelegateForPluginDocument();
- int zoom;
- if (function == PageZoom::RESET) {
- zoom = 0;
- } else if (function == PageZoom::ZOOM_OUT) {
- zoom = -1;
- } else if (function == PageZoom::ZOOM_IN) {
- zoom = 1;
- } else {
- NOTREACHED();
- return;
- }
- delegate->Zoom(zoom);
- return;
- }
int zoom_level = webview()->zoomLevel();
int new_zoom_level = webview()->setZoomLevel(false,
« no previous file with comments | « chrome/renderer/render_view.h ('k') | chrome/renderer/webplugin_delegate_pepper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698