Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Unified Diff: webkit/tools/test_shell/webwidget_host.h

Issue 1606: hodgepodge for test_shell.cc (Closed)
Patch Set: update some comments Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/tools/test_shell/webview_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « webkit/tools/test_shell/webview_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698