Changeset 69871 in webkit


Ignore:
Timestamp:
Oct 15, 2010 12:16:43 PM (13 years ago)
Author:
andersca@apple.com
Message:

Add FindIndicatorWindow class
https://bugs.webkit.org/show_bug.cgi?id=47731

Reviewed by Sam Weinig.

WebCore:

Export symbols needed by the FindIndicator in WebKit2.

  • WebCore.exp.in:

WebKit2:

  • UIProcess/API/mac/FindIndicatorWindow.h: Added.
  • UIProcess/API/mac/FindIndicatorWindow.mm: Added.

(-[WebFindIndicatorView _initWithFindIndicator:WebKit::]):
Initialize the find indicator view.

(-[WebFindIndicatorView drawRect:]):
Ask the find indicator to draw.

(-[WebFindIndicatorView isFlipped]):
Return YES.

(WebKit::FindIndicatorWindow::~FindIndicatorWindow):
Make sure to close the window.

(WebKit::FindIndicatorWindow::setFindIndicator):
Update the find indicator window.

(WebKit::FindIndicatorWindow::closeWindow):
Close and release the window.

  • UIProcess/API/mac/PageClientImpl.h:
  • UIProcess/API/mac/PageClientImpl.mm:

(WebKit::PageClientImpl::setFindIndicator):
Create a find indicator window.

  • WebKit2.xcodeproj/project.pbxproj:

Add new files.

Location:
trunk
Files:
1 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r69869 r69871  
     12010-10-15  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Add FindIndicatorWindow class
     6        https://bugs.webkit.org/show_bug.cgi?id=47731
     7
     8        Export symbols needed by the FindIndicator in WebKit2.
     9
     10        * WebCore.exp.in:
     11
    1122010-10-15  Leandro Pereira  <leandro@profusion.mobi>
    213
  • trunk/WebCore/WebCore.exp.in

    r69844 r69871  
    351351__ZN7WebCore15GraphicsContext22beginTransparencyLayerEf
    352352__ZN7WebCore15GraphicsContext4clipERKNS_9FloatRectE
     353__ZN7WebCore15GraphicsContext5scaleERKNS_9FloatSizeE
     354__ZN7WebCore15GraphicsContext15setFillGradientEN3WTF10PassRefPtrINS_8GradientEEE
     355__ZN7WebCore4PathD1Ev
     356__ZN7WebCore8Gradient12addColorStopEfRKNS_5ColorE
     357__ZN7WebCore4PathC1Ev
     358__ZN7WebCore15GraphicsContext4clipERKNS_4PathE
     359__ZN7WebCore15GraphicsContext8fillPathEv
     360__ZN7WebCore4Path14addRoundedRectERKNS_9FloatRectERKNS_9FloatSizeE
     361__ZN7WebCore15GraphicsContext7addPathERKNS_4PathE
    353362__ZN7WebCore15GraphicsContext4saveEv
    354363__ZN7WebCore15GraphicsContext7restoreEv
     
    708717__ZN7WebCore8FormData6createEPKvm
    709718__ZN7WebCore8FormDataD1Ev
     719__ZN7WebCore8GradientC1ERKNS_10FloatPointES3_
    710720__ZN7WebCore8IntPointC1ERK8_NSPoint
    711721__ZN7WebCore8PositionC1EN3WTF10PassRefPtrINS_4NodeEEEi
  • trunk/WebKit2/ChangeLog

    r69866 r69871  
     12010-10-15  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Add FindIndicatorWindow class
     6        https://bugs.webkit.org/show_bug.cgi?id=47731
     7
     8        * UIProcess/API/mac/FindIndicatorWindow.h: Added.
     9        * UIProcess/API/mac/FindIndicatorWindow.mm: Added.
     10        (-[WebFindIndicatorView _initWithFindIndicator:WebKit::]):
     11        Initialize the find indicator view.
     12
     13        (-[WebFindIndicatorView drawRect:]):
     14        Ask the find indicator to draw.
     15
     16        (-[WebFindIndicatorView isFlipped]):
     17        Return YES.
     18
     19        (WebKit::FindIndicatorWindow::~FindIndicatorWindow):
     20        Make sure to close the window.
     21
     22        (WebKit::FindIndicatorWindow::setFindIndicator):
     23        Update the find indicator window.
     24
     25        (WebKit::FindIndicatorWindow::closeWindow):
     26        Close and release the window.
     27
     28        * UIProcess/API/mac/PageClientImpl.h:
     29        * UIProcess/API/mac/PageClientImpl.mm:
     30        (WebKit::PageClientImpl::setFindIndicator):
     31        Create a find indicator window.
     32
     33        * WebKit2.xcodeproj/project.pbxproj:
     34        Add new files.
     35
    1362010-10-15  Anders Carlsson  <andersca@apple.com>
    237
  • trunk/WebKit2/UIProcess/API/mac/FindIndicatorWindow.h

    r69870 r69871  
    2424 */
    2525
    26 #ifndef PageClientImpl_h
    27 #define PageClientImpl_h
     26#ifndef FindIndicatorWindow_h
     27#define FindIndicatorWindow_h
    2828
    29 #include "PageClient.h"
    30 #include <wtf/RetainPtr.h>
     29#import <wtf/Noncopyable.h>
     30#import <wtf/PassOwnPtr.h>
     31#import <wtf/RefPtr.h>
     32#import <wtf/RetainPtr.h>
    3133
    3234@class WKView;
    33 @class WebEditorUndoTargetObjC;
    3435
    3536namespace WebKit {
    3637
    37 // NOTE: This does not use String::operator NSString*() since that function
    38 // expects to be called on the thread running WebCore.
    39 NSString* nsStringFromWebCoreString(const String&);
     38class FindIndicator;
    4039
    41 class PageClientImpl : public PageClient {
     40class FindIndicatorWindow {
     41    WTF_MAKE_NONCOPYABLE(FindIndicatorWindow);
     42
    4243public:
    43     static PassOwnPtr<PageClientImpl> create(WKView*);
    44     virtual ~PageClientImpl();
    45 
    46 private:
    47     PageClientImpl(WKView*);
    48 
    49     virtual void processDidExit();
    50     virtual void processDidRevive();
    51     virtual void takeFocus(bool direction);
    52     virtual void toolTipChanged(const String& oldToolTip, const String& newToolTip);
    53     virtual void setCursor(const WebCore::Cursor&);
    54     virtual void setViewportArguments(const WebCore::ViewportArguments&);
    55 
    56     void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo);
    57     void clearAllEditCommands();
    58     void setEditCommandState(const String& commandName, bool isEnabled, int state);
    59 
    60     WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&);
    61     WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
    62 
    63     virtual void didNotHandleKeyEvent(const NativeWebKeyboardEvent&);
     44    static PassOwnPtr<FindIndicatorWindow> create(WKView *);
     45    ~FindIndicatorWindow();
    6446
    6547    void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut);
    6648
    67 #if USE(ACCELERATED_COMPOSITING)
    68     void pageDidEnterAcceleratedCompositing();
    69     void pageDidLeaveAcceleratedCompositing();
    70 #endif
     49private:
     50    explicit FindIndicatorWindow(WKView *);
     51    void closeWindow();
    7152
    7253    WKView* m_wkView;
    73     RetainPtr<WebEditorUndoTargetObjC> m_undoTarget;
     54    RefPtr<FindIndicator> m_findIndicator;
     55    RetainPtr<NSWindow> m_findIndicatorWindow;
    7456};
    7557
    7658} // namespace WebKit
    7759
    78 #endif // PageClientImpl_h
     60#endif // FindIndicatorWindow_h
  • trunk/WebKit2/UIProcess/API/mac/PageClientImpl.h

    r69862 r69871  
    3434
    3535namespace WebKit {
     36
     37class FindIndicatorWindow;
    3638
    3739// NOTE: This does not use String::operator NSString*() since that function
     
    7274    WKView* m_wkView;
    7375    RetainPtr<WebEditorUndoTargetObjC> m_undoTarget;
     76    OwnPtr<FindIndicatorWindow> m_findIndicatorWindow;
    7477};
    7578
  • trunk/WebKit2/UIProcess/API/mac/PageClientImpl.mm

    r69862 r69871  
    2626#import "PageClientImpl.h"
    2727
     28#import "FindIndicator.h"
     29#import "FindIndicatorWindow.h"
    2830#import "WKAPICast.h"
    2931#import "WKStringCF.h"
     
    226228}
    227229
    228 void PageClientImpl::setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut)
    229 {
    230     // FIXME: Implement.
     230void PageClientImpl::setFindIndicator(PassRefPtr<FindIndicator> findIndicator, bool fadeOut)
     231{
     232    if (!findIndicator) {
     233        m_findIndicatorWindow = 0;
     234        return;
     235    }
     236
     237    if (!m_findIndicatorWindow)
     238        m_findIndicatorWindow = FindIndicatorWindow::create(m_wkView);
     239
     240    m_findIndicatorWindow->setFindIndicator(findIndicator, fadeOut);
    231241}
    232242
  • trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r69862 r69871  
    129129                1A910071126675C4001842F5 /* FindIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A91006F126675C3001842F5 /* FindIndicator.h */; };
    130130                1A910072126675C4001842F5 /* FindIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A910070126675C4001842F5 /* FindIndicator.cpp */; };
     131                1A91010A1268C8CA001842F5 /* FindIndicatorWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9101081268C8CA001842F5 /* FindIndicatorWindow.h */; };
     132                1A91010B1268C8CA001842F5 /* FindIndicatorWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A9101091268C8CA001842F5 /* FindIndicatorWindow.mm */; };
    131133                1AA1CC5D100FA1A10078DEBC /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */; };
    132134                1AA1CD07100FA1BA0078DEBC /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CD06100FA1BA0078DEBC /* Carbon.framework */; };
     
    596598                1A91006F126675C3001842F5 /* FindIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindIndicator.h; sourceTree = "<group>"; };
    597599                1A910070126675C4001842F5 /* FindIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FindIndicator.cpp; sourceTree = "<group>"; };
     600                1A9101081268C8CA001842F5 /* FindIndicatorWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindIndicatorWindow.h; sourceTree = "<group>"; };
     601                1A9101091268C8CA001842F5 /* FindIndicatorWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FindIndicatorWindow.mm; sourceTree = "<group>"; };
    598602                1AA1C79A100E7FC50078DEBC /* WebCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
    599603                1AA1C7DE100E846E0078DEBC /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
     
    15001504                                BC111B4B112F619200337BAB /* PageClientImpl.h */,
    15011505                                BC111B4C112F619200337BAB /* PageClientImpl.mm */,
     1506                                1A9101081268C8CA001842F5 /* FindIndicatorWindow.h */,
     1507                                1A9101091268C8CA001842F5 /* FindIndicatorWindow.mm */,
    15021508                                BC8699B2116AADAA002A925B /* WKView.h */,
    15031509                                BC8699B3116AADAA002A925B /* WKView.mm */,
     
    20352041                                1A90C2A312650C60003E44D4 /* FindPageOverlay.h in Headers */,
    20362042                                1A910071126675C4001842F5 /* FindIndicator.h in Headers */,
     2043                                1A91010A1268C8CA001842F5 /* FindIndicatorWindow.h in Headers */,
    20372044                        );
    20382045                        runOnlyForDeploymentPostprocessing = 0;
     
    23422349                                C01A260112662F2100C9ED55 /* BackingStoreCG.cpp in Sources */,
    23432350                                1A910072126675C4001842F5 /* FindIndicator.cpp in Sources */,
     2351                                1A91010B1268C8CA001842F5 /* FindIndicatorWindow.mm in Sources */,
    23442352                        );
    23452353                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.