Changeset 195421 in webkit


Ignore:
Timestamp:
Jan 21, 2016, 1:51:39 PM (10 years ago)
Author:
Beth Dakin
Message:

Add the ability to update WebKitAdditions to WK2
https://bugs.webkit.org/show_bug.cgi?id=153320
-and corresponding-
rdar://problem/23639629

Reviewed by Anders Carlsson.

Source/WebCore:

This SPI is un-used now.

  • platform/spi/mac/NSSpellCheckerSPI.h:

Source/WebKit2:

  • UIProcess/API/Cocoa/WKWebView.mm:
  • UIProcess/API/mac/WKView.mm:
  • UIProcess/Cocoa/WebViewImpl.h:

(WebKit::WebViewImpl::createWeakPtr):

  • UIProcess/Cocoa/WebViewImpl.mm:

(WebKit::WebViewImpl::updateWebViewImplAdditions):
(WebKit::WebViewImpl::showCandidates):
(WebKit::WebViewImpl::webViewImplAdditionsWillDestroyView):
(WebKit::trackingAreaOptions):
(WebKit::WebViewImpl::~WebViewImpl):
(WebKit::WebViewImpl::becomeFirstResponder):
(WebKit::WebViewImpl::selectionDidChange):
(WebKit::WebViewImpl::handleRequestedCandidates):
(WebKit::textCheckingResultFromNSTextCheckingResult):

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r195415 r195421  
     12016-01-21  Beth Dakin  <bdakin@apple.com>
     2
     3        Add the ability to update WebKitAdditions to WK2
     4        https://bugs.webkit.org/show_bug.cgi?id=153320
     5        -and corresponding-
     6        rdar://problem/23639629
     7
     8        Reviewed by Anders Carlsson.
     9
     10        This SPI is un-used now.
     11        * platform/spi/mac/NSSpellCheckerSPI.h:
     12
    1132016-01-21  Simon Fraser  <simon.fraser@apple.com>
    214
  • trunk/Source/WebCore/platform/spi/mac/NSSpellCheckerSPI.h

    r193645 r195421  
    3232@interface NSSpellChecker ()
    3333- (NSInteger)requestCandidatesForSelectedRange:(NSRange)selectedRange inString:(NSString *)stringToCheck types:(NSTextCheckingTypes)checkingTypes options:(NSDictionary<NSString *, id> *)options inSpellDocumentWithTag:(NSInteger)tag completionHandler:(void (^)(NSInteger sequenceNumber, NSArray<NSTextCheckingResult *> *candidates))completionHandler;
    34 - (void)showCandidates:(NSArray<NSTextCheckingResult *> *)candidates forString:(NSString *)string inRect:(NSRect)rectOfTypedString view:(NSView *)view completionHandler:(void (^)(NSTextCheckingResult *acceptedCandidate))completionBlock;
    3534@end
    3635
  • trunk/Source/WebKit2/ChangeLog

    r195412 r195421  
     12016-01-21  Beth Dakin  <bdakin@apple.com>
     2
     3        Add the ability to update WebKitAdditions to WK2
     4        https://bugs.webkit.org/show_bug.cgi?id=153320
     5        -and corresponding-
     6        rdar://problem/23639629
     7
     8        Reviewed by Anders Carlsson.
     9
     10        * UIProcess/API/Cocoa/WKWebView.mm:
     11        * UIProcess/API/mac/WKView.mm:
     12        * UIProcess/Cocoa/WebViewImpl.h:
     13        (WebKit::WebViewImpl::createWeakPtr):
     14        * UIProcess/Cocoa/WebViewImpl.mm:
     15        (WebKit::WebViewImpl::updateWebViewImplAdditions):
     16        (WebKit::WebViewImpl::showCandidates):
     17        (WebKit::WebViewImpl::webViewImplAdditionsWillDestroyView):
     18        (WebKit::trackingAreaOptions):
     19        (WebKit::WebViewImpl::~WebViewImpl):
     20        (WebKit::WebViewImpl::becomeFirstResponder):
     21        (WebKit::WebViewImpl::selectionDidChange):
     22        (WebKit::WebViewImpl::handleRequestedCandidates):
     23        (WebKit::textCheckingResultFromNSTextCheckingResult):
     24
    1252016-01-19  Ada Chan  <adachan@apple.com>
    226
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r195317 r195421  
    43484348#endif
    43494349
     4350#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 && USE(APPLE_INTERNAL_SDK)
     4351#import <WebKitAdditions/WKWebViewAdditionsMac.mm>
     4352#endif
     4353
    43504354#endif // WK_API_ENABLED
  • trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm

    r194496 r195421  
    14481448@end
    14491449
     1450#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 && USE(APPLE_INTERNAL_SDK)
     1451#import <WebKitAdditions/WKViewAdditions.mm>
     1452#endif
     1453
    14501454#endif // PLATFORM(MAC)
  • trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h

    r195078 r195421  
    5151OBJC_CLASS _WKThumbnailView;
    5252
     53#if USE(APPLE_INTERNAL_SDK) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
     54#import <WebKitAdditions/WebViewImplAdditionsDeclarations.h>
     55#endif
     56
    5357@protocol WebViewImplDelegate
    5458
     
    471475    void rightMouseUp(NSEvent *);
    472476
     477    void updateWebViewImplAdditions();
     478    void showCandidates(NSArray *candidates, NSString *, NSRect rectOfTypedString, NSView *, void (^completionHandler)(NSTextCheckingResult *acceptedCandidate));
     479    void webViewImplAdditionsWillDestroyView();
     480
     481#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 && USE(APPLE_INTERNAL_SDK)
     482#import <WebKitAdditions/WebViewImplAdditions.h>
     483#endif
     484
    473485private:
    474486    WeakPtr<WebViewImpl> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
  • trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm

    r195078 r195421  
    420420@end
    421421
     422#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 && USE(APPLE_INTERNAL_SDK)
     423#import <WebKitAdditions/WebViewImplAdditions.mm>
     424#else
     425namespace WebKit {
     426
     427void WebViewImpl::updateWebViewImplAdditions()
     428{
     429}
     430
     431void WebViewImpl::showCandidates(NSArray *candidates, NSString *string, NSRect rectOfTypedString, NSView *view, void (^completionHandler)(NSTextCheckingResult *acceptedCandidate))
     432{
     433}
     434
     435void WebViewImpl::webViewImplAdditionsWillDestroyView()
     436{
     437}
     438
     439} // namespace WebKit
     440#endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 && USE(APPLE_INTERNAL_SDK)
     441
    422442namespace WebKit {
    423443
     
    494514
    495515    [m_immediateActionController willDestroyView:m_view];
     516    webViewImplAdditionsWillDestroyView();
    496517
    497518    m_page->close();
     
    567588
    568589    m_inBecomeFirstResponder = false;
     590
     591    updateWebViewImplAdditions();
    569592
    570593    if (direction != NSDirectSelection) {
     
    17261749    updateFontPanelIfNeeded();
    17271750#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
     1751    updateWebViewImplAdditions();
    17281752    if (!m_page->editorState().isMissingPostLayoutData)
    17291753        requestCandidatesForSelectionIfNeeded();
     
    21352159
    21362160    auto weakThis = createWeakPtr();
    2137     [[NSSpellChecker sharedSpellChecker] showCandidates:candidates forString:postLayoutData.stringForCandidateRequest inRect:postLayoutData.selectionClipRect view:m_view completionHandler:[weakThis](NSTextCheckingResult *acceptedCandidate) {
     2161    showCandidates(candidates, postLayoutData.stringForCandidateRequest, postLayoutData.selectionClipRect, m_view, [weakThis](NSTextCheckingResult *acceptedCandidate) {
    21382162        dispatch_async(dispatch_get_main_queue(), ^{
    21392163            if (!weakThis)
     
    21412165            weakThis->handleAcceptedCandidate(acceptedCandidate);
    21422166        });
    2143     }];
     2167    });
    21442168}
    21452169
Note: See TracChangeset for help on using the changeset viewer.