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

Unified Diff: Source/WebKit/chromium/src/WebFrameImpl.cpp

Issue 15071004: Plumb edit commands to plugins (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 7 years, 7 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 | « Source/WebKit/chromium/src/WebFrameImpl.h ('k') | Source/WebKit/chromium/src/WebPluginContainerImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/src/WebFrameImpl.cpp
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp
index fc902cdf00708d5c0fca4bf1f18df61680957a91..cc629b32d36635eb78fdef14c0f94af3c59bb300 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp
@@ -309,6 +309,14 @@ WebPluginContainerImpl* WebFrameImpl::pluginContainerFromFrame(Frame* frame)
return static_cast<WebPluginContainerImpl *>(pluginDocument->pluginWidget());
}
+WebPluginContainerImpl* WebFrameImpl::pluginContainerFromNode(WebCore::Frame* frame, const WebNode& node)
+{
+ WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(frame);
+ if (pluginContainer)
+ return pluginContainer;
+ return static_cast<WebPluginContainerImpl*>(node.pluginContainer());
+}
+
// Simple class to override some of PrintContext behavior. Some of the methods
// made virtual so that they can be overridden by ChromePluginPrintContext.
class ChromePrintContext : public PrintContext {
@@ -1202,9 +1210,7 @@ bool WebFrameImpl::executeCommand(const WebString& name, const WebNode& node)
if (command[command.length() - 1] == UChar(':'))
command = command.substring(0, command.length() - 1);
- WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(frame());
- if (!pluginContainer)
- pluginContainer = static_cast<WebPluginContainerImpl*>(node.pluginContainer());
+ WebPluginContainerImpl* pluginContainer = pluginContainerFromNode(frame(), node);
if (pluginContainer && pluginContainer->executeEditCommand(name))
return true;
@@ -1233,11 +1239,15 @@ bool WebFrameImpl::executeCommand(const WebString& name, const WebNode& node)
return result;
}
-bool WebFrameImpl::executeCommand(const WebString& name, const WebString& value)
+bool WebFrameImpl::executeCommand(const WebString& name, const WebString& value, const WebNode& node)
{
ASSERT(frame());
String webName = name;
+ WebPluginContainerImpl* pluginContainer = pluginContainerFromNode(frame(), node);
+ if (pluginContainer && pluginContainer->executeEditCommand(name, value))
+ return true;
+
// moveToBeginningOfDocument and moveToEndfDocument are only handled by WebKit for editable nodes.
if (!frame()->editor()->canEdit() && webName == "moveToBeginningOfDocument")
return viewImpl()->propagateScroll(ScrollUp, ScrollByDocument);
« no previous file with comments | « Source/WebKit/chromium/src/WebFrameImpl.h ('k') | Source/WebKit/chromium/src/WebPluginContainerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698