diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-07 23:57:20 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-07 23:57:20 +0000 |
commit | c4ae36f2aca531a9d9abf39d1a54b1a267e2c1f1 (patch) | |
tree | d837911a58ec6afdf570426d87186cfa07bc9dc8 /ui | |
parent | 53e38faa6860a4c8fec6752b36d77ec0c1ff585f (diff) | |
download | chromium_src-c4ae36f2aca531a9d9abf39d1a54b1a267e2c1f1.zip chromium_src-c4ae36f2aca531a9d9abf39d1a54b1a267e2c1f1.tar.gz chromium_src-c4ae36f2aca531a9d9abf39d1a54b1a267e2c1f1.tar.bz2 |
Pass touch events from the chrome viewer process in Metro Ash on Windows 8 to the browser process.
cpu:- Please review everything.
sky:- Please review changes to content\browser, chrome\browser and ui\aura.
This effectively also means that we won't be passing the fake mouse messages generated by Windows for touch events
from the Ash viewer process to chrome.
This only fixes touch handling in Metro Ash. Touch handling for desktop chrome Aura will be fixed in a subsequent CL.
BUG=151718
R=cpu,sky
Review URL: https://codereview.chromium.org/11472013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171888 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/aura/remote_root_window_host_win.cc | 35 | ||||
-rw-r--r-- | ui/aura/remote_root_window_host_win.h | 3 | ||||
-rw-r--r-- | ui/metro_viewer/metro_viewer_messages.h | 12 |
3 files changed, 50 insertions, 0 deletions
diff --git a/ui/aura/remote_root_window_host_win.cc b/ui/aura/remote_root_window_host_win.cc index 1b11500..e3a75ca 100644 --- a/ui/aura/remote_root_window_host_win.cc +++ b/ui/aura/remote_root_window_host_win.cc @@ -26,6 +26,9 @@ namespace { const char* kRootWindowHostWinKey = "__AURA_REMOTE_ROOT_WINDOW_HOST_WIN__"; +// The touch id to be used for touch events coming in from Windows Ash. +const int kRemoteWindowTouchId = 10; + } // namespace RemoteRootWindowHostWin* g_instance = NULL; @@ -68,6 +71,12 @@ bool RemoteRootWindowHostWin::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(MetroViewerHostMsg_Character, OnChar) IPC_MESSAGE_HANDLER(MetroViewerHostMsg_VisibilityChanged, OnVisibilityChanged) + IPC_MESSAGE_HANDLER(MetroViewerHostMsg_TouchDown, + OnTouchDown) + IPC_MESSAGE_HANDLER(MetroViewerHostMsg_TouchUp, + OnTouchUp) + IPC_MESSAGE_HANDLER(MetroViewerHostMsg_TouchMoved, + OnTouchMoved) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; @@ -227,4 +236,30 @@ void RemoteRootWindowHostWin::OnVisibilityChanged(bool visible) { delegate_->OnHostActivated(); } +void RemoteRootWindowHostWin::OnTouchDown(int32 x, int32 y, uint64 timestamp) { + ui::TouchEvent event(ui::ET_TOUCH_PRESSED, + gfx::Point(x, y), + kRemoteWindowTouchId, + base::TimeDelta::FromMicroseconds(timestamp)); + delegate_->OnHostTouchEvent(&event); +} + +void RemoteRootWindowHostWin::OnTouchUp(int32 x, int32 y, uint64 timestamp) { + ui::TouchEvent event(ui::ET_TOUCH_RELEASED, + gfx::Point(x, y), + kRemoteWindowTouchId, + base::TimeDelta::FromMicroseconds(timestamp)); + delegate_->OnHostTouchEvent(&event); +} + +void RemoteRootWindowHostWin::OnTouchMoved(int32 x, + int32 y, + uint64 timestamp) { + ui::TouchEvent event(ui::ET_TOUCH_MOVED, + gfx::Point(x, y), + kRemoteWindowTouchId, + base::TimeDelta::FromMicroseconds(timestamp)); + delegate_->OnHostTouchEvent(&event); +} + } // namespace aura diff --git a/ui/aura/remote_root_window_host_win.h b/ui/aura/remote_root_window_host_win.h index 73a566d..2c9ef0b 100644 --- a/ui/aura/remote_root_window_host_win.h +++ b/ui/aura/remote_root_window_host_win.h @@ -62,6 +62,9 @@ class AURA_EXPORT RemoteRootWindowHostWin : public RootWindowHost { uint32 scan_code, uint32 flags); void OnVisibilityChanged(bool visible); + void OnTouchDown(int32 x, int32 y, uint64 timestamp); + void OnTouchUp(int32 x, int32 y, uint64 timestamp); + void OnTouchMoved(int32 x, int32 y, uint64 timestamp); // RootWindowHost overrides: virtual void SetDelegate(RootWindowHostDelegate* delegate) OVERRIDE; diff --git a/ui/metro_viewer/metro_viewer_messages.h b/ui/metro_viewer/metro_viewer_messages.h index 3da4cbc..994b40f 100644 --- a/ui/metro_viewer/metro_viewer_messages.h +++ b/ui/metro_viewer/metro_viewer_messages.h @@ -51,3 +51,15 @@ IPC_MESSAGE_CONTROL4(MetroViewerHostMsg_Character, // Informs the browser that the visibiliy of the viewer has changed. IPC_MESSAGE_CONTROL1(MetroViewerHostMsg_VisibilityChanged, bool /* visible */); +IPC_MESSAGE_CONTROL3(MetroViewerHostMsg_TouchDown, + int32, /* x-coordinate */ + int32, /* y-coordinate */ + uint64) /* timestamp */ +IPC_MESSAGE_CONTROL3(MetroViewerHostMsg_TouchUp, + int32, /* x-coordinate */ + int32, /* y-coordinate */ + uint64) /* timestamp */ +IPC_MESSAGE_CONTROL3(MetroViewerHostMsg_TouchMoved, + int32, /* x-coordinate */ + int32, /* y-coordinate */ + uint64) /* timestamp */ |