RESOLVED FIXED 111246
PDFPlugin: Hook up Services
https://bugs.webkit.org/show_bug.cgi?id=111246
Summary PDFPlugin: Hook up Services
Tim Horton
Reported 2013-03-02 00:15:25 PST
OS X Services, that is. <rdar://problem/13062672>
Attachments
preliminary patch (10.83 KB, patch)
2013-03-02 00:40 PST, Tim Horton
no flags
patch (17.70 KB, patch)
2013-03-02 16:47 PST, Tim Horton
no flags
delete some duplicated code now that we can use pluginViewForFrame in WebPageMac (18.22 KB, patch)
2013-03-02 17:00 PST, Tim Horton
no flags
patch (18.18 KB, patch)
2013-03-04 00:10 PST, Tim Horton
no flags
Tim Horton
Comment 1 2013-03-02 00:40:11 PST
Created attachment 191099 [details] preliminary patch Missing a changelog and support for services that consume rich text data (e.g. New Email with Selection). Not sure how to best implement that yet.
Tim Horton
Comment 2 2013-03-02 16:47:39 PST
Tim Horton
Comment 3 2013-03-02 17:00:11 PST
Created attachment 191120 [details] delete some duplicated code now that we can use pluginViewForFrame in WebPageMac
Alexey Proskuryakov
Comment 4 2013-03-02 18:24:04 PST
Comment on attachment 191120 [details] delete some duplicated code now that we can use pluginViewForFrame in WebPageMac View in context: https://bugs.webkit.org/attachment.cgi?id=191120&action=review r=me assuming that you tested how this affects Flash. > Source/WebKit2/WebProcess/Plugins/Plugin.h:270 > + virtual String getStringSelection() const = 0; This function name doesn't look grammatically correct to me. Perhaps "get string for selection" or "get selection string" would be better? > Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp:190 > - EditorState state = m_page->editorState(); > - > - m_page->send(Messages::WebPageProxy::EditorStateChanged(state)); > + m_page->didChangeSelection(); Should the rest of the function go to Page now? I think that it's best to not have much logic in WebEditorClient.cpp. > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:566 > + if (pluginView->getStringSelection() != emptyString()) { Using a special value for in-band error reporting doesn't seem to cause any issues here, but it would be nicer to not overload String semantics. If doing it differently is much harder, perhaps null could be the special value, not empty? > Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm:662 > + if (selection != emptyString()) { > + stringValue = selection; What is the danger in returning the empty string? Please add a comment to the code, because it looks surprising.
Tim Horton
Comment 5 2013-03-02 18:31:19 PST
(In reply to comment #4) > (From update of attachment 191120 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=191120&action=review > > r=me assuming that you tested how this affects Flash. > > > Source/WebKit2/WebProcess/Plugins/Plugin.h:270 > > + virtual String getStringSelection() const = 0; > > This function name doesn't look grammatically correct to me. Perhaps "get string for selection" or "get selection string" would be better? I thought the same thing, but this is the name that Pasteboard and WebPage already use... > > Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp:190 > > - EditorState state = m_page->editorState(); > > - > > - m_page->send(Messages::WebPageProxy::EditorStateChanged(state)); > > + m_page->didChangeSelection(); > > Should the rest of the function go to Page now? I think that it's best to not have much logic in WebEditorClient.cpp. Don't see why not. > > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:566 > > + if (pluginView->getStringSelection() != emptyString()) { > > Using a special value for in-band error reporting doesn't seem to cause any issues here, but it would be nicer to not overload String semantics. If doing it differently is much harder, perhaps null could be the special value, not empty? Probably a good plan. > > > Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm:662 > > + if (selection != emptyString()) { > > + stringValue = selection; > > What is the danger in returning the empty string? Please add a comment to the code, because it looks surprising. No danger, I was just trying to keep the behavior precisely the same in the case where the plugin doesn't support getStringSelection() (i.e. all non-PDFPlugin plugins).
Tim Horton
Comment 6 2013-03-03 23:14:41 PST
(In reply to comment #5) > > > Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp:190 > > > - EditorState state = m_page->editorState(); > > > - > > > - m_page->send(Messages::WebPageProxy::EditorStateChanged(state)); > > > + m_page->didChangeSelection(); > > > > Should the rest of the function go to Page now? I think that it's best to not have much logic in WebEditorClient.cpp. > > Don't see why not. To clarify, you just meant the call to updateGlobalSelection (and the implementation of updateGlobalSelection), right? Not the InjectedBundleEditorClient notification.
Tim Horton
Comment 7 2013-03-04 00:10:09 PST
Created attachment 191165 [details] patch Still some things to discuss with Alexey, but I renamed getStringSelection -> getSelectionString (seems more important to have a good name here than match the rest of the code) and switched to using a null string for the "there is no selection" case.
Alexey Proskuryakov
Comment 8 2013-03-04 09:18:18 PST
> > > Should the rest of the function go to Page now? I think that it's best to not have much logic in WebEditorClient.cpp. > To clarify, you just meant the call to updateGlobalSelection (and the implementation of updateGlobalSelection), right? Not the InjectedBundleEditorClient notification. Honestly, I did not look at what else the function did, so this was truly a question.
Tim Horton
Comment 9 2013-03-04 13:57:16 PST
Note You need to log in before you can comment on or make changes to this bug.