summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/webwidget_host_win.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 23:30:22 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 23:30:22 +0000
commit62cb33cae4bad68a085b50832c8a7f1e1c2e917c (patch)
tree4eddbf29c7ae1c41fd1300ae4ce95b817404bbaf /webkit/tools/test_shell/webwidget_host_win.cc
parent57346c5659ada3c2a06095afac6e53bedf41ab94 (diff)
downloadchromium_src-62cb33cae4bad68a085b50832c8a7f1e1c2e917c.zip
chromium_src-62cb33cae4bad68a085b50832c8a7f1e1c2e917c.tar.gz
chromium_src-62cb33cae4bad68a085b50832c8a7f1e1c2e917c.tar.bz2
Use Webkit::WebInputEvent and remove webkit/glue/webinputevent.
This change adds a temporary dependency on src/KeyIdentifier.{h,cpp} which I am going to remove after this CL. I didn't want to grow this CL any larger. R=dglazkov Review URL: http://codereview.chromium.org/53099 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12728 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/webwidget_host_win.cc')
-rw-r--r--webkit/tools/test_shell/webwidget_host_win.cc34
1 files changed, 22 insertions, 12 deletions
diff --git a/webkit/tools/test_shell/webwidget_host_win.cc b/webkit/tools/test_shell/webwidget_host_win.cc
index fc4be75..76a5973 100644
--- a/webkit/tools/test_shell/webwidget_host_win.cc
+++ b/webkit/tools/test_shell/webwidget_host_win.cc
@@ -9,9 +9,16 @@
#include "base/win_util.h"
#include "skia/ext/platform_canvas.h"
#include "skia/ext/platform_canvas_win.h"
-#include "webkit/glue/webinputevent.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h"
+#include "third_party/WebKit/WebKit/chromium/public/win/WebInputEventFactory.h"
#include "webkit/glue/webwidget.h"
+using WebKit::WebInputEvent;
+using WebKit::WebInputEventFactory;
+using WebKit::WebKeyboardEvent;
+using WebKit::WebMouseEvent;
+using WebKit::WebMouseWheelEvent;
+
static const wchar_t kWindowClassName[] = L"WebWidgetHost";
/*static*/
@@ -273,23 +280,24 @@ void WebWidgetHost::Resize(LPARAM lparam) {
}
void WebWidgetHost::MouseEvent(UINT message, WPARAM wparam, LPARAM lparam) {
- WebMouseEvent event(view_, message, wparam, lparam);
+ const WebMouseEvent& event = WebInputEventFactory::mouseEvent(
+ view_, message, wparam, lparam);
switch (event.type) {
- case WebInputEvent::MOUSE_MOVE:
+ case WebInputEvent::MouseMove:
TrackMouseLeave(true);
break;
- case WebInputEvent::MOUSE_LEAVE:
+ case WebInputEvent::MouseLeave:
TrackMouseLeave(false);
break;
- case WebInputEvent::MOUSE_DOWN:
+ case WebInputEvent::MouseDown:
SetCapture(view_);
- // This mimics a temporary workaround in RenderWidgetHostViewWin
- // for bug 765011 to get focus when the mouse is clicked. This
- // happens after the mouse down event is sent to the renderer
- // because normally Windows does a WM_SETFOCUS after WM_LBUTTONDOWN.
+ // This mimics a temporary workaround in RenderWidgetHostViewWin for bug
+ // 765011 to get focus when the mouse is clicked. This happens after the
+ // mouse down event is sent to the renderer because normally Windows does
+ // a WM_SETFOCUS after WM_LBUTTONDOWN.
::SetFocus(view_);
break;
- case WebInputEvent::MOUSE_UP:
+ case WebInputEvent::MouseUp:
if (GetCapture() == view_)
ReleaseCapture();
break;
@@ -298,12 +306,14 @@ void WebWidgetHost::MouseEvent(UINT message, WPARAM wparam, LPARAM lparam) {
}
void WebWidgetHost::WheelEvent(WPARAM wparam, LPARAM lparam) {
- WebMouseWheelEvent event(view_, WM_MOUSEWHEEL, wparam, lparam);
+ const WebMouseWheelEvent& event = WebInputEventFactory::mouseWheelEvent(
+ view_, WM_MOUSEWHEEL, wparam, lparam);
webwidget_->HandleInputEvent(&event);
}
void WebWidgetHost::KeyEvent(UINT message, WPARAM wparam, LPARAM lparam) {
- WebKeyboardEvent event(view_, message, wparam, lparam);
+ const WebKeyboardEvent& event = WebInputEventFactory::keyboardEvent(
+ view_, message, wparam, lparam);
webwidget_->HandleInputEvent(&event);
}