summaryrefslogtreecommitdiff
path: root/Tools/WebKitTestRunner/PlatformWebView.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Tools/WebKitTestRunner/PlatformWebView.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Tools/WebKitTestRunner/PlatformWebView.h')
-rw-r--r--Tools/WebKitTestRunner/PlatformWebView.h74
1 files changed, 45 insertions, 29 deletions
diff --git a/Tools/WebKitTestRunner/PlatformWebView.h b/Tools/WebKitTestRunner/PlatformWebView.h
index fa8d1236c..aa0ab2e49 100644
--- a/Tools/WebKitTestRunner/PlatformWebView.h
+++ b/Tools/WebKitTestRunner/PlatformWebView.h
@@ -26,29 +26,28 @@
#ifndef PlatformWebView_h
#define PlatformWebView_h
-#include <WebKit2/WKRetainPtr.h>
+#include "TestOptions.h"
+#include <WebKit/WKRetainPtr.h>
-#if defined(__APPLE__) && __APPLE__
-#ifdef __OBJC__
-@class WKView;
-@class WebKitTestRunnerWindow;
+#if PLATFORM(COCOA) && !defined(BUILDING_GTK__)
+#include <WebKit/WKFoundation.h>
+OBJC_CLASS NSView;
+OBJC_CLASS UIView;
+OBJC_CLASS TestRunnerWKWebView;
+OBJC_CLASS WKWebViewConfiguration;
+OBJC_CLASS WebKitTestRunnerWindow;
+
+#if WK_API_ENABLED
+typedef TestRunnerWKWebView *PlatformWKView;
#else
-class WKView;
-class WebKitTestRunnerWindow;
+typedef NSView *PlatformWKView;
#endif
-typedef WKView* PlatformWKView;
-typedef WebKitTestRunnerWindow* PlatformWindow;
+typedef WebKitTestRunnerWindow *PlatformWindow;
#elif defined(BUILDING_GTK__)
typedef struct _GtkWidget GtkWidget;
typedef WKViewRef PlatformWKView;
typedef GtkWidget* PlatformWindow;
#elif PLATFORM(EFL)
-typedef struct _Ecore_Evas Ecore_Evas;
-#if USE(EO)
-typedef struct _Eo_Opaque Evas_Object;
-#else
-typedef struct _Evas_Object Evas_Object;
-#endif
typedef Evas_Object* PlatformWKView;
typedef Ecore_Evas* PlatformWindow;
#endif
@@ -57,43 +56,60 @@ namespace WTR {
class PlatformWebView {
public:
- PlatformWebView(WKContextRef, WKPageGroupRef, WKPageRef relatedPage, WKDictionaryRef options = 0);
+#if PLATFORM(COCOA)
+ PlatformWebView(WKWebViewConfiguration*, const TestOptions&);
+#else
+ PlatformWebView(WKPageConfigurationRef, const TestOptions&);
+#endif
~PlatformWebView();
WKPageRef page();
PlatformWKView platformView() { return m_view; }
PlatformWindow platformWindow() { return m_window; }
- void resizeTo(unsigned width, unsigned height);
- void focus();
+ static PlatformWindow keyWindow();
- // Window snapshot is always enabled by default on all other platform.
- static bool windowSnapshotEnabled() { return true; }
+ enum class WebViewSizingMode {
+ Default,
+ HeightRespectsStatusBar
+ };
+
+ void resizeTo(unsigned width, unsigned height, WebViewSizingMode = WebViewSizingMode::Default);
+ void focus();
WKRect windowFrame();
- void setWindowFrame(WKRect);
+ void setWindowFrame(WKRect, WebViewSizingMode = WebViewSizingMode::Default);
void didInitializeClients();
void addChromeInputField();
void removeChromeInputField();
void makeWebViewFirstResponder();
- void setWindowIsKey(bool isKey) { m_windowIsKey = isKey; }
+ void setWindowIsKey(bool);
bool windowIsKey() const { return m_windowIsKey; }
+
+ void removeFromWindow();
+ void addToWindow();
-#if PLATFORM(MAC) || PLATFORM(EFL)
- bool viewSupportsOptions(WKDictionaryRef) const;
-#else
- bool viewSupportsOptions(WKDictionaryRef) const { return true; }
-#endif
+ bool viewSupportsOptions(const TestOptions&) const;
WKRetainPtr<WKImageRef> windowSnapshotImage();
- WKDictionaryRef options() const { return m_options.get(); }
+ const TestOptions& options() const { return m_options; }
+
+ void changeWindowScaleIfNeeded(float newScale);
+ void setNavigationGesturesEnabled(bool);
+
+#if PLATFORM(GTK)
+ void dismissAllPopupMenus();
+#endif
private:
+ void forceWindowFramesChanged();
+
PlatformWKView m_view;
PlatformWindow m_window;
bool m_windowIsKey;
- WKRetainPtr<WKDictionaryRef> m_options;
+ const TestOptions m_options;
+
#if PLATFORM(EFL)
bool m_usingFixedLayout;
#endif