| Index: webkit/tools/test_shell/webwidget_host.h
|
| diff --git a/webkit/tools/test_shell/webwidget_host.h b/webkit/tools/test_shell/webwidget_host.h
|
| index b7a59451def0a35956baeeab7c0469a8d022d947..9404c97cf382e582a52df0c1d2a509e9ca1905e1 100644
|
| --- a/webkit/tools/test_shell/webwidget_host.h
|
| +++ b/webkit/tools/test_shell/webwidget_host.h
|
| @@ -5,7 +5,9 @@
|
| #ifndef WEBKIT_TOOLS_TEST_SHELL_WEBWIDGET_HOST_H__
|
| #define WEBKIT_TOOLS_TEST_SHELL_WEBWIDGET_HOST_H__
|
|
|
| +#if defined(OS_WIN)
|
| #include <windows.h>
|
| +#endif
|
|
|
| #include "base/gfx/rect.h"
|
| #include "base/scoped_ptr.h"
|
| @@ -21,19 +23,27 @@ class Size;
|
| // This class is a simple HWND-based host for a WebWidget
|
| class WebWidgetHost {
|
| public:
|
| - // The new instance is deleted once the associated HWND is destroyed. The
|
| - // newly created window should be resized after it is created, using the
|
| - // MoveWindow (or equivalent) function.
|
| + // The new instance is deleted once the associated native window is
|
| + // destroyed. The newly created window should be resized after it is
|
| + // created, using the MoveWindow (or equivalent) function.
|
| +#if defined(OS_WIN)
|
| static WebWidgetHost* Create(HWND parent_window, WebWidgetDelegate* delegate);
|
| -
|
| static WebWidgetHost* FromWindow(HWND hwnd);
|
|
|
| HWND window_handle() const { return hwnd_; }
|
| + void SetCursor(HCURSOR cursor);
|
| +#else // null port.
|
| + static WebWidgetHost* Create(void* parent_window, WebWidgetDelegate* delegate);
|
| + static WebWidgetHost* FromWindow(void* window);
|
| +
|
| + void* window_handle() const { return window_; }
|
| + void SetCursor(void* cursor);
|
| +#endif
|
| +
|
| WebWidget* webwidget() const { return webwidget_; }
|
|
|
| void DidInvalidateRect(const gfx::Rect& rect);
|
| void DidScrollRect(int dx, int dy, const gfx::Rect& clip_rect);
|
| - void SetCursor(HCURSOR cursor);
|
|
|
| void DiscardBackingStore();
|
|
|
| @@ -41,8 +51,10 @@ class WebWidgetHost {
|
| WebWidgetHost();
|
| ~WebWidgetHost();
|
|
|
| +#if defined(OS_WIN)
|
| // Per-class wndproc. Returns true if the event should be swallowed.
|
| virtual bool WndProc(UINT message, WPARAM wparam, LPARAM lparam);
|
| + static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
|
|
| void Paint();
|
| void Resize(LPARAM lparam);
|
| @@ -55,6 +67,7 @@ class WebWidgetHost {
|
| void TrackMouseLeave(bool enable);
|
| void ResetScrollRect();
|
| void PaintRect(const gfx::Rect& rect);
|
| +#endif
|
|
|
| void set_painting(bool value) {
|
| #ifndef NDEBUG
|
| @@ -62,9 +75,11 @@ class WebWidgetHost {
|
| #endif
|
| }
|
|
|
| - static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
| -
|
| +#if defined(OS_WIN)
|
| HWND hwnd_;
|
| +#else // null port.
|
| + void* window_;
|
| +#endif
|
| WebWidget* webwidget_;
|
| scoped_ptr<gfx::PlatformCanvasWin> canvas_;
|
|
|
|
|