diff options
author | Steve Block <steveblock@google.com> | 2011-05-18 13:36:51 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-05-24 15:38:28 +0100 |
commit | 2fc2651226baac27029e38c9d6ef883fa32084db (patch) | |
tree | e396d4bf89dcce6ed02071be66212495b1df1dec /Source/WebKit2/UIProcess/win/WebView.h | |
parent | b3725cedeb43722b3b175aaeff70552e562d2c94 (diff) | |
download | external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.zip external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.gz external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.bz2 |
Merge WebKit at r78450: Initial merge by git.
Change-Id: I6d3e5f1f868ec266a0aafdef66182ddc3f265dc1
Diffstat (limited to 'Source/WebKit2/UIProcess/win/WebView.h')
-rw-r--r-- | Source/WebKit2/UIProcess/win/WebView.h | 52 |
1 files changed, 47 insertions, 5 deletions
diff --git a/Source/WebKit2/UIProcess/win/WebView.h b/Source/WebKit2/UIProcess/win/WebView.h index dfb5ed1..297b6ad 100644 --- a/Source/WebKit2/UIProcess/win/WebView.h +++ b/Source/WebKit2/UIProcess/win/WebView.h @@ -28,21 +28,30 @@ #include "APIObject.h" #include "PageClient.h" +#include "WKView.h" #include "WebPageProxy.h" +#include <ShlObj.h> +#include <WebCore/COMPtr.h> +#include <WebCore/DragActions.h> +#include <WebCore/DragData.h> #include <WebCore/WindowMessageListener.h> #include <wtf/Forward.h> #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> +interface IDropTargetHelper; + namespace WebKit { class DrawingAreaProxy; -class WebView : public APIObject, public PageClient, WebCore::WindowMessageListener { +class WebView : public APIObject, public PageClient, WebCore::WindowMessageListener, public IDropTarget { public: static PassRefPtr<WebView> create(RECT rect, WebContext* context, WebPageGroup* pageGroup, HWND parentWindow) { - return adoptRef(new WebView(rect, context, pageGroup, parentWindow)); + RefPtr<WebView> webView = adoptRef(new WebView(rect, context, pageGroup, parentWindow)); + webView->initialize(); + return webView; } ~WebView(); @@ -50,8 +59,22 @@ public: void setParentWindow(HWND); void windowAncestryDidChange(); void setIsInWindow(bool); - void setOverrideCursor(HCURSOR overrideCursor); + void setOverrideCursor(HCURSOR); void setInitialFocus(bool forward); + void setFindIndicatorCallback(WKViewFindIndicatorCallback, void*); + WKViewFindIndicatorCallback getFindIndicatorCallback(void**); + void initialize(); + + // IUnknown + virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject); + virtual ULONG STDMETHODCALLTYPE AddRef(void); + virtual ULONG STDMETHODCALLTYPE Release(void); + + // IDropTarget + virtual HRESULT STDMETHODCALLTYPE DragEnter(IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect); + virtual HRESULT STDMETHODCALLTYPE DragOver(DWORD grfKeyState, POINTL pt, DWORD* pdwEffect); + virtual HRESULT STDMETHODCALLTYPE DragLeave(); + virtual HRESULT STDMETHODCALLTYPE Drop(IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect); WebPageProxy* page() const { return m_page.get(); } @@ -64,7 +87,6 @@ private: static LRESULT CALLBACK WebViewWndProc(HWND, UINT, WPARAM, LPARAM); LRESULT wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); - void setWasActivatedByMouseEvent(bool flag) { m_wasActivatedByMouseEvent = flag; } LRESULT onMouseEvent(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled); LRESULT onWheelEvent(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled); LRESULT onKeyEvent(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled); @@ -77,6 +99,9 @@ private: LRESULT onTimerEvent(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled); LRESULT onShowWindowEvent(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled); LRESULT onSetCursor(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled); + + void paint(HDC, const WebCore::IntRect& dirtyRect); + void setWasActivatedByMouseEvent(bool flag) { m_wasActivatedByMouseEvent = flag; } bool onIMEStartComposition(); bool onIMEComposition(LPARAM); bool onIMEEndComposition(); @@ -116,6 +141,7 @@ private: virtual bool isViewInWindow(); virtual void processDidCrash(); virtual void didRelaunchProcess(); + virtual void pageClosed(); virtual void takeFocus(bool direction); virtual void toolTipChanged(const WTF::String&, const WTF::String&); virtual void setCursor(const WebCore::Cursor&); @@ -125,13 +151,16 @@ private: virtual void setEditCommandState(const WTF::String&, bool, int); virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&); virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&); - virtual void didNotHandleKeyEvent(const NativeWebKeyboardEvent&); + virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled); virtual void compositionSelectionChanged(bool); virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*); virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*); virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut); #if USE(ACCELERATED_COMPOSITING) + virtual void enterAcceleratedCompositingMode(const LayerTreeContext&); + virtual void exitAcceleratedCompositingMode(); + virtual void pageDidEnterAcceleratedCompositing(); virtual void pageDidLeaveAcceleratedCompositing(); void switchToDrawingAreaTypeIfNecessary(DrawingAreaInfo::Type); @@ -141,6 +170,8 @@ private: void didFinishLoadingDataForCustomRepresentation(const CoreIPC::DataReference&); virtual double customRepresentationZoomFactor(); virtual void setCustomRepresentationZoomFactor(double); + WebCore::DragOperation keyStateToDragOperation(DWORD grfKeyState) const; + virtual void didChangeScrollbarsForMainFrame() const; virtual HWND nativeWindow(); @@ -164,6 +195,17 @@ private: RefPtr<WebPageProxy> m_page; unsigned m_inIMEComposition; + + WKViewFindIndicatorCallback m_findIndicatorCallback; + void* m_findIndicatorCallbackContext; + + COMPtr<IDataObject> m_dragData; + COMPtr<IDropTargetHelper> m_dropTargetHelper; + // FIXME: This variable is part of a workaround. The drop effect (pdwEffect) passed to Drop is incorrect. + // We set this variable in DragEnter and DragOver so that it can be used in Drop to set the correct drop effect. + // Thus, on return from DoDragDrop we have the correct pdwEffect for the drag-and-drop operation. + // (see https://bugs.webkit.org/show_bug.cgi?id=29264) + DWORD m_lastDropEffect; }; } // namespace WebKit |