2010-12-09 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Dec 2010 18:07:52 +0000 (18:07 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Dec 2010 18:07:52 +0000 (18:07 +0000)
commit32fd619703c6e990ce15638fdb28ea2e019f9ee1
tree0231370568eb92300db6fad37fe5bc18428a9ad4
parentfd8e006ebdc2c7e9ce05bd16c7d970640bedbd3a
2010-12-09  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dan Bernstein.

        Implement "Use Selection for Find" in WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=50737
        <rdar://problem/8564881>

        Implement a TakeFindStringFromSelection editor command. This is
        used solely to implement the "Use Selection for Find" menu command
        on Mac, and is not made available to script. On WebKit2, it is
        very convenient to reuse the editing machinery since this command
        is very similar to Copy.

        * editing/Editor.h:
        * editing/EditorCommand.cpp:
        (WebCore::executeTakeFindStringFromSelection): Call to a mac-only Editor function.
        (WebCore::enabledTakeFindStringFromSelection): Check using Editor::canCopyExcludingStandaloneImage
        (WebCore::createCommandMap): Add "TakeFindStringFromSelection" command.
        * editing/mac/EditorMac.mm:
        (WebCore::Editor::canCopyExcludingStandaloneImages): Helper function; we can't use Editor::canCopy
        since it would make no sense to enable "Use Selection for Find" when viewing a standalone image
        document.
        (WebCore::Editor::takeFindStringFromSelection): Implement by copying the selected text
        to the special Find pasteboard.
2010-12-09  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dan Bernstein.

        Implement "Use Selection for Find" in WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=50737
        <rdar://problem/8564881>

        * UIProcess/API/mac/WKView.mm: Add support for the takeFindStringFromSelection:
        selector as a command.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/editing/Editor.h
WebCore/editing/EditorCommand.cpp
WebCore/editing/mac/EditorMac.mm
WebKit2/ChangeLog
WebKit2/UIProcess/API/mac/WKView.mm