OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_TOOLS_TEST_SHELL_WEBWIDGET_HOST_H_ | 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_WEBWIDGET_HOST_H_ |
6 #define WEBKIT_TOOLS_TEST_SHELL_WEBWIDGET_HOST_H_ | 6 #define WEBKIT_TOOLS_TEST_SHELL_WEBWIDGET_HOST_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/gfx/native_widget_types.h" | 9 #include "base/gfx/native_widget_types.h" |
10 #include "base/gfx/platform_canvas.h" | 10 #include "base/gfx/platform_canvas.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 gfx::ViewHandle window_handle() const { return view_; } | 35 gfx::ViewHandle window_handle() const { return view_; } |
36 WebWidget* webwidget() const { return webwidget_; } | 36 WebWidget* webwidget() const { return webwidget_; } |
37 | 37 |
38 void DidInvalidateRect(const gfx::Rect& rect); | 38 void DidInvalidateRect(const gfx::Rect& rect); |
39 void DidScrollRect(int dx, int dy, const gfx::Rect& clip_rect); | 39 void DidScrollRect(int dx, int dy, const gfx::Rect& clip_rect); |
40 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
41 void SetCursor(HCURSOR cursor); | 41 void SetCursor(HCURSOR cursor); |
42 #endif | 42 #endif |
43 | 43 |
44 void DiscardBackingStore(); | 44 void DiscardBackingStore(); |
45 void Paint(); | |
46 | 45 |
47 protected: | 46 protected: |
48 WebWidgetHost(); | 47 WebWidgetHost(); |
49 ~WebWidgetHost(); | 48 ~WebWidgetHost(); |
50 | 49 |
51 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
52 // Per-class wndproc. Returns true if the event should be swallowed. | 51 // Per-class wndproc. Returns true if the event should be swallowed. |
53 virtual bool WndProc(UINT message, WPARAM wparam, LPARAM lparam); | 52 virtual bool WndProc(UINT message, WPARAM wparam, LPARAM lparam); |
54 | 53 |
| 54 void Paint(); |
55 void Resize(LPARAM lparam); | 55 void Resize(LPARAM lparam); |
56 void MouseEvent(UINT message, WPARAM wparam, LPARAM lparam); | 56 void MouseEvent(UINT message, WPARAM wparam, LPARAM lparam); |
57 void WheelEvent(WPARAM wparam, LPARAM lparam); | 57 void WheelEvent(WPARAM wparam, LPARAM lparam); |
58 void KeyEvent(UINT message, WPARAM wparam, LPARAM lparam); | 58 void KeyEvent(UINT message, WPARAM wparam, LPARAM lparam); |
59 void CaptureLostEvent(); | 59 void CaptureLostEvent(); |
60 void SetFocus(bool enable); | 60 void SetFocus(bool enable); |
61 | 61 |
62 static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); | 62 static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); |
63 #elif defined(OS_MACOSX) | 63 #elif defined(OS_MACOSX) |
64 // These need to be called from a non-subclass, so they need to be public. | 64 // These need to be called from a non-subclass, so they need to be public. |
65 public: | 65 public: |
| 66 void Paint(); |
66 void Resize(const gfx::Rect& rect); | 67 void Resize(const gfx::Rect& rect); |
67 void MouseEvent(NSEvent *); | 68 void MouseEvent(NSEvent *); |
68 void WheelEvent(NSEvent *); | 69 void WheelEvent(NSEvent *); |
69 void KeyEvent(NSEvent *); | 70 void KeyEvent(NSEvent *); |
70 void SetFocus(bool enable); | 71 void SetFocus(bool enable); |
71 protected: | 72 protected: |
72 #elif defined(OS_LINUX) | |
73 public: | |
74 void WindowDestroyed(); | |
75 void Resize(const gfx::Size& size); | |
76 #endif | 73 #endif |
77 | 74 |
78 void TrackMouseLeave(bool enable); | 75 void TrackMouseLeave(bool enable); |
79 void ResetScrollRect(); | 76 void ResetScrollRect(); |
80 void PaintRect(const gfx::Rect& rect); | 77 void PaintRect(const gfx::Rect& rect); |
81 | 78 |
82 void set_painting(bool value) { | 79 void set_painting(bool value) { |
83 #ifndef NDEBUG | 80 #ifndef NDEBUG |
84 painting_ = value; | 81 painting_ = value; |
85 #endif | 82 #endif |
(...skipping 12 matching lines...) Expand all Loading... |
98 int scroll_dy_; | 95 int scroll_dy_; |
99 | 96 |
100 bool track_mouse_leave_; | 97 bool track_mouse_leave_; |
101 | 98 |
102 #ifndef NDEBUG | 99 #ifndef NDEBUG |
103 bool painting_; | 100 bool painting_; |
104 #endif | 101 #endif |
105 }; | 102 }; |
106 | 103 |
107 #endif // WEBKIT_TOOLS_TEST_SHELL_WEBWIDGET_HOST_H_ | 104 #endif // WEBKIT_TOOLS_TEST_SHELL_WEBWIDGET_HOST_H_ |
OLD | NEW |