Move DataDetectors scanning code to WebCore
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Nov 2014 21:33:03 +0000 (21:33 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Nov 2014 21:33:03 +0000 (21:33 +0000)
commit4d5e74195f8146f0ae5fb8eee7ad0de1a34a6f2c
tree60ce96a29ae0c2125ea0e6fc35c55ca6ee2a1aa0
parent745f07e53190eca2587b71866ab213bc1266d8c1
Move DataDetectors scanning code to WebCore
https://bugs.webkit.org/show_bug.cgi?id=138731
<rdar://problem/18877535>

Reviewed by Anders Carlsson.

Move DataDetectors scanning code to WebCore, so that both WebKits can use it.

* Shared/TextIndicator.cpp:
(WebKit::TextIndicator::createWithRange):
Move createWithRange in from WebPageMac's textIndicatorForRange.

(WebKit::TextIndicator::createWithSelectionInFrame):
* Shared/TextIndicator.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createSelectionSnapshot):
* WebProcess/WebPage/WebFrame.h:
Constify some things.

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):
Avoid using the DD result if it didn't come with a non-null Range.
Make use of detectItemAroundHitTestResult and TextIndicator::createWithRange.

(WebKit::scanForDataDetectedItems): Deleted.
(WebKit::textIndicatorForRange): Deleted.
Moved these two to other places.

* WebCore.exp.in:
Export our new function.

* WebCore.xcodeproj/project.pbxproj:
Add DataDetection.{mm, h}
Adjust the project so that editing/mac actually points to editing/mac instead of editing/

* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
Swap to PLATFORM(MAC) instead of !PLATFORM(IOS).
Move DictionaryLookup.{mm, h} to editing/mac, where they were in the project but not on disk.

* editing/mac/DataDetection.h: Added.
* editing/mac/DataDetection.mm: Added.
(WebCore::DataDetection::detectItemAroundHitTestResult):
Moved from WebKit2.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176137 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/editing/mac/DataDetection.h [new file with mode: 0644]
Source/WebCore/editing/mac/DataDetection.mm [new file with mode: 0644]
Source/WebCore/editing/mac/DictionaryLookup.h [moved from Source/WebCore/editing/DictionaryLookup.h with 98% similarity]
Source/WebCore/editing/mac/DictionaryLookup.mm [moved from Source/WebCore/editing/DictionaryLookup.mm with 99% similarity]
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/TextIndicator.cpp
Source/WebKit2/Shared/TextIndicator.h
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.h
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm