summaryrefslogtreecommitdiffstats
path: root/WebKit/win/WebView.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/win/WebView.h')
-rw-r--r--WebKit/win/WebView.h88
1 files changed, 65 insertions, 23 deletions
diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h
index 56fb40c..424b03a 100644
--- a/WebKit/win/WebView.h
+++ b/WebKit/win/WebView.h
@@ -32,12 +32,17 @@
#include "WebPreferences.h"
#include <WebCore/DragActions.h>
#include <WebCore/IntRect.h>
-#include <WebCore/Timer.h>
+#include <WebCore/RefCountedGDIHandle.h>
+#include <WebCore/SuspendableTimer.h>
#include <WebCore/WindowMessageListener.h>
-#include <WebCore/WKCACFLayer.h>
-#include <WebCore/WKCACFLayerRenderer.h>
#include <wtf/HashSet.h>
#include <wtf/OwnPtr.h>
+#include <wtf/RefPtr.h>
+
+#if USE(ACCELERATED_COMPOSITING)
+#include <WebCore/WKCACFLayer.h>
+#include <WebCore/WKCACFLayerRenderer.h>
+#endif
class FullscreenVideoController;
class WebBackForwardList;
@@ -45,6 +50,9 @@ class WebFrame;
class WebInspector;
class WebInspectorClient;
+typedef WebCore::RefCountedGDIHandle<HBITMAP> RefCountedHBITMAP;
+typedef WebCore::RefCountedGDIHandle<HRGN> RefCountedHRGN;
+
WebView* kit(WebCore::Page*);
WebCore::Page* core(IWebView*);
@@ -61,6 +69,9 @@ class WebView
, public IWebNotificationObserver
, public IDropTarget
, WebCore::WindowMessageListener
+#if USE(ACCELERATED_COMPOSITING)
+ , WebCore::WKCACFLayerRendererClient
+#endif
{
public:
static WebView* createInstance();
@@ -689,6 +700,20 @@ public:
/* [in] */ RECT rect,
/* [in] */ OLE_HANDLE dc);
+ virtual HRESULT STDMETHODCALLTYPE paintScrollViewRectToContextAtPoint(
+ /* [in] */ RECT rect,
+ /* [in] */ POINT pt,
+ /* [in] */ OLE_HANDLE dc);
+
+ virtual HRESULT STDMETHODCALLTYPE reportException(
+ /* [in] */ JSContextRef context,
+ /* [in] */ JSValueRef exception);
+
+ virtual HRESULT STDMETHODCALLTYPE elementFromJS(
+ /* [in] */ JSContextRef context,
+ /* [in] */ JSValueRef nodeObject,
+ /* [retval][out] */ IDOMElement **element);
+
virtual HRESULT STDMETHODCALLTYPE setCustomHTMLTokenizerTimeDelay(
/* [in] */ double timeDelay);
@@ -761,9 +786,9 @@ public:
virtual HRESULT STDMETHODCALLTYPE invalidateBackingStore(const RECT*);
- virtual HRESULT STDMETHODCALLTYPE whiteListAccessFromOrigin(BSTR sourceOrigin, BSTR destinationProtocol, BSTR destinationHost, BOOL allowDestinationSubdomains);
- virtual HRESULT STDMETHODCALLTYPE resetOriginAccessWhiteLists();
-
+ virtual HRESULT STDMETHODCALLTYPE addOriginAccessWhitelistEntry(BSTR sourceOrigin, BSTR destinationProtocol, BSTR destinationHost, BOOL allowDestinationSubdomains);
+ virtual HRESULT STDMETHODCALLTYPE removeOriginAccessWhitelistEntry(BSTR sourceOrigin, BSTR destinationProtocol, BSTR destinationHost, BOOL allowDestinationSubdomains);
+ virtual HRESULT STDMETHODCALLTYPE resetOriginAccessWhitelists();
virtual HRESULT STDMETHODCALLTYPE setHistoryDelegate(IWebHistoryDelegate* historyDelegate);
virtual HRESULT STDMETHODCALLTYPE historyDelegate(IWebHistoryDelegate** historyDelegate);
@@ -779,9 +804,12 @@ public:
virtual HRESULT STDMETHODCALLTYPE geolocationDidFailWithError(IWebError* error);
virtual HRESULT STDMETHODCALLTYPE setDomainRelaxationForbiddenForURLScheme(BOOL forbidden, BSTR scheme);
+ virtual HRESULT STDMETHODCALLTYPE registerURLSchemeAsSecure(BSTR);
+
+ virtual HRESULT STDMETHODCALLTYPE nextDisplayIsSynchronous();
// WebView
- bool shouldUseEmbeddedView(const WebCore::String& mimeType) const;
+ bool shouldUseEmbeddedView(const WTF::String& mimeType) const;
WebCore::Page* page();
bool handleMouseEvent(UINT, WPARAM, LPARAM);
@@ -812,6 +840,7 @@ public:
void frameRect(RECT* rect);
void closeWindow();
void closeWindowSoon();
+ void closeWindowTimerFired();
bool didClose() const { return m_didClose; }
bool transparent() const { return m_transparent; }
@@ -833,11 +862,11 @@ public:
// Convenient to be able to violate the rules of COM here for easy movement to the frame.
WebFrame* topLevelFrame() const { return m_mainFrame; }
- const WebCore::String& userAgentForKURL(const WebCore::KURL& url);
+ const WTF::String& userAgentForKURL(const WebCore::KURL& url);
static bool canHandleRequest(const WebCore::ResourceRequest&);
- static WebCore::String standardUserAgentWithApplicationName(const WebCore::String&);
+ static WTF::String standardUserAgentWithApplicationName(const WTF::String&);
void setIsBeingDestroyed() { m_isBeingDestroyed = true; }
bool isBeingDestroyed() const { return m_isBeingDestroyed; }
@@ -847,7 +876,7 @@ public:
bool isPainting() const { return m_paintCount > 0; }
- void setToolTip(const WebCore::String&);
+ void setToolTip(const WTF::String&);
void registerForIconNotification(bool listen);
void dispatchDidReceiveIconFromWebFrame(WebFrame*);
@@ -865,6 +894,7 @@ public:
void cancelDeleteBackingStoreSoon();
HWND topLevelParent() const { return m_topLevelParent; }
+ HWND viewWindow() const { return m_viewWindow; }
void updateActiveState();
@@ -875,12 +905,14 @@ public:
#if USE(ACCELERATED_COMPOSITING)
void setRootLayerNeedsDisplay() { if (m_layerRenderer) m_layerRenderer->setNeedsDisplay(); }
- void setRootChildLayer(WebCore::PlatformLayer* layer);
+ void setRootChildLayer(WebCore::WKCACFLayer* layer);
#endif
void enterFullscreenForNode(WebCore::Node*);
void exitFullscreen();
+ void setLastCursor(HCURSOR cursor) { m_lastSetCursor = cursor; }
+
private:
void setZoomMultiplier(float multiplier, bool isTextOnly);
float zoomMultiplier(bool isTextOnly);
@@ -892,6 +924,8 @@ private:
HRESULT resetZoom(bool isTextOnly);
bool active();
+ void sizeChanged(const WebCore::IntSize&);
+
enum WindowsToPaint { PaintWebViewOnly, PaintWebViewAndChildren };
void paintIntoBackingStore(WebCore::FrameView*, HDC bitmapDC, const WebCore::IntRect& dirtyRect, WindowsToPaint);
void updateBackingStore(WebCore::FrameView*, HDC = 0, bool backingStoreCompletelyDirty = false, WindowsToPaint = PaintWebViewOnly);
@@ -904,6 +938,11 @@ private:
// (see https://bugs.webkit.org/show_bug.cgi?id=29264)
DWORD m_lastDropEffect;
+#if USE(ACCELERATED_COMPOSITING)
+ // WKCACFLayerRendererClient
+ virtual bool shouldRender() const;
+#endif
+
protected:
static bool registerWebViewWindowClass();
static LRESULT CALLBACK WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
@@ -914,7 +953,6 @@ protected:
void preflightSpellChecker();
bool continuousCheckingAllowed();
void initializeToolTipWindow();
- void closeWindowTimerFired(WebCore::Timer<WebView>*);
void prepareCandidateWindow(WebCore::Frame*, HIMC);
void updateSelectionForIME();
LRESULT onIMERequestCharPosition(WebCore::Frame*, IMECHARPOSITION*);
@@ -938,9 +976,9 @@ protected:
WebFrame* m_mainFrame;
WebCore::Page* m_page;
- OwnPtr<HBITMAP> m_backingStoreBitmap;
+ RefPtr<RefCountedHBITMAP> m_backingStoreBitmap;
SIZE m_backingStoreSize;
- OwnPtr<HRGN> m_backingStoreDirtyRegion;
+ RefPtr<RefCountedHRGN> m_backingStoreDirtyRegion;
COMPtr<IWebEditingDelegate> m_editingDelegate;
COMPtr<IWebFrameLoadDelegate> m_frameLoadDelegate;
@@ -959,11 +997,12 @@ protected:
bool m_userAgentOverridden;
bool m_useBackForwardList;
- WebCore::String m_userAgentCustom;
- WebCore::String m_userAgentStandard;
+ WTF::String m_userAgentCustom;
+ WTF::String m_userAgentStandard;
float m_zoomMultiplier;
- WebCore::String m_overrideEncoding;
- WebCore::String m_applicationName;
+ bool m_zoomsTextOnly;
+ WTF::String m_overrideEncoding;
+ WTF::String m_applicationName;
bool m_mouseActivated;
// WebCore dragging logic needs to be able to inspect the drag data
// this is updated in DragEnter/Leave/Drop
@@ -979,19 +1018,19 @@ protected:
bool m_hasCustomDropTarget;
unsigned m_inIMEComposition;
HWND m_toolTipHwnd;
- WebCore::String m_toolTip;
+ WTF::String m_toolTip;
bool m_deleteBackingStoreTimerActive;
bool m_transparent;
static bool s_allowSiteSpecificHacks;
- WebCore::Timer<WebView> m_closeWindowTimer;
+ WebCore::SuspendableTimer* m_closeWindowTimer;
OwnPtr<TRACKMOUSEEVENT> m_mouseOutTracker;
HWND m_topLevelParent;
- OwnPtr<HashSet<WebCore::String> > m_embeddedViewMIMETypes;
+ OwnPtr<HashSet<WTF::String> > m_embeddedViewMIMETypes;
//Variables needed to store gesture information
RefPtr<WebCore::Node> m_gestureTargetNode;
@@ -1008,12 +1047,15 @@ protected:
bool isAcceleratedCompositing() const { return m_isAcceleratedCompositing; }
void setAcceleratedCompositing(bool);
void updateRootLayerContents();
- void resizeLayerRenderer() { m_layerRenderer->resize(); }
- void layerRendererBecameVisible() { m_layerRenderer->createRenderer(); }
+ void layerRendererBecameVisible();
OwnPtr<WebCore::WKCACFLayerRenderer> m_layerRenderer;
bool m_isAcceleratedCompositing;
#endif
+
+ bool m_nextDisplayIsSynchronous;
+
+ HCURSOR m_lastSetCursor;
};
#endif