Changeset 89939 in webkit
- Timestamp:
- Jun 28, 2011 9:58:00 AM (13 years ago)
- Location:
- trunk/Source/WebKit/chromium
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r89872 r89939 1 2011-06-27 James Hawkins <jhawkins@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 [Chromium] Pass an optional WebNode that is the node receiving the context menu action. 6 https://bugs.webkit.org/show_bug.cgi?id=63503 7 8 * public/WebFrame.h: 9 * src/WebFrameImpl.cpp: 10 (WebKit::pluginContainerFromNode): 11 (WebKit::WebFrameImpl::executeCommand): 12 (WebKit::WebFrameImpl::printBegin): 13 * src/WebFrameImpl.h: 14 1 15 2011-06-27 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
trunk/Source/WebKit/chromium/public/WebFrame.h
r89773 r89939 393 393 // Unselect, etc. See EditorCommand.cpp for the full list of supported 394 394 // commands. 395 virtual bool executeCommand(const WebString& ) = 0;395 virtual bool executeCommand(const WebString&, const WebNode& = WebNode()) = 0; 396 396 virtual bool executeCommand(const WebString&, const WebString& value) = 0; 397 397 virtual bool isCommandEnabled(const WebString&) const = 0; -
trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp
r89773 r89939 286 286 } 287 287 288 static WebPluginContainerImpl* pluginContainerFromNode(const WebNode& node) 289 { 290 const Node* coreNode = node.constUnwrap<Node>(); 291 if (coreNode->hasTagName(HTMLNames::objectTag) || coreNode->hasTagName(HTMLNames::embedTag)) { 292 RenderObject* object = coreNode->renderer(); 293 if (object && object->isWidget()) { 294 Widget* widget = toRenderWidget(object)->widget(); 295 if (widget && widget->isPluginContainer()) 296 return static_cast<WebPluginContainerImpl*>(widget); 297 } 298 } 299 return 0; 300 } 301 288 302 WebPluginContainerImpl* WebFrameImpl::pluginContainerFromFrame(Frame* frame) 289 303 { … … 297 311 298 312 // Simple class to override some of PrintContext behavior. Some of the methods 299 // made virtual so that they can be overrid en by ChromePluginPrintContext.313 // made virtual so that they can be overridden by ChromePluginPrintContext. 300 314 class ChromePrintContext : public PrintContext { 301 315 WTF_MAKE_NONCOPYABLE(ChromePrintContext); … … 1101 1115 } 1102 1116 1103 bool WebFrameImpl::executeCommand(const WebString& name )1117 bool WebFrameImpl::executeCommand(const WebString& name, const WebNode& node) 1104 1118 { 1105 1119 ASSERT(frame()); … … 1121 1135 if (command == "Copy") { 1122 1136 WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(frame()); 1137 if (!pluginContainer) 1138 pluginContainer = pluginContainerFromNode(node); 1123 1139 if (pluginContainer) { 1124 1140 pluginContainer->copy(); … … 1308 1324 } else { 1309 1325 // We only support printing plugin nodes for now. 1310 const Node* coreNode = constrainToNode.constUnwrap<Node>(); 1311 if (coreNode->hasTagName(HTMLNames::objectTag) || coreNode->hasTagName(HTMLNames::embedTag)) { 1312 RenderObject* object = coreNode->renderer(); 1313 if (object && object->isWidget()) { 1314 Widget* widget = toRenderWidget(object)->widget(); 1315 if (widget && widget->isPluginContainer()) 1316 pluginContainer = static_cast<WebPluginContainerImpl*>(widget); 1317 } 1318 } 1326 pluginContainer = pluginContainerFromNode(constrainToNode); 1319 1327 } 1320 1328 -
trunk/Source/WebKit/chromium/src/WebFrameImpl.h
r89773 r89939 150 150 virtual bool firstRectForCharacterRange(unsigned location, unsigned length, WebRect&) const; 151 151 virtual size_t characterIndexForPoint(const WebPoint&) const; 152 virtual bool executeCommand(const WebString& );152 virtual bool executeCommand(const WebString&, const WebNode& = WebNode()); 153 153 virtual bool executeCommand(const WebString&, const WebString& value); 154 154 virtual bool isCommandEnabled(const WebString&) const;
Note: See TracChangeset
for help on using the changeset viewer.