Index: ui/views/win/hwnd_message_handler.cc |
=================================================================== |
--- ui/views/win/hwnd_message_handler.cc (revision 174871) |
+++ ui/views/win/hwnd_message_handler.cc (working copy) |
@@ -295,6 +295,10 @@ |
// The thickness of an auto-hide taskbar in pixels. |
const int kAutoHideTaskbarThicknessPx = 2; |
+// The touch id to be used for touch events coming in from Windows Aura |
+// Desktop. |
+const int kDesktopChromeAuraTouchId = 9; |
sky
2013/01/07 15:53:45
Do we need to make sure this doesn't conflict with
ananta
2013/01/08 00:50:22
We shouldn't be conflicting with anything. We have
|
+ |
} // namespace |
// A scoping class that prevents a window from being able to redraw in response |
@@ -1974,10 +1978,27 @@ |
if (GetTouchInputInfo(reinterpret_cast<HTOUCHINPUT>(l_param), |
num_points, input.get(), sizeof(TOUCHINPUT))) { |
for (int i = 0; i < num_points; ++i) { |
- if (input[i].dwFlags & TOUCHEVENTF_DOWN) |
+ ui::EventType touch_event_type = ui::ET_UNKNOWN; |
+ |
+ if (input[i].dwFlags & TOUCHEVENTF_DOWN) { |
touch_ids_.insert(input[i].dwID); |
- if (input[i].dwFlags & TOUCHEVENTF_UP) |
+ touch_event_type = ui::ET_TOUCH_PRESSED; |
+ } else if (input[i].dwFlags & TOUCHEVENTF_UP) { |
touch_ids_.erase(input[i].dwID); |
+ touch_event_type = ui::ET_TOUCH_RELEASED; |
+ } else if (input[i].dwFlags & TOUCHEVENTF_MOVE) { |
+ touch_event_type = ui::ET_TOUCH_MOVED; |
+ } |
+ |
+ if (touch_event_type != ui::ET_UNKNOWN) { |
+ ui::TouchEvent event( |
+ touch_event_type, |
+ gfx::Point(TOUCH_COORD_TO_PIXEL(input[i].x), |
+ TOUCH_COORD_TO_PIXEL(input[i].y)), |
+ kDesktopChromeAuraTouchId, |
+ base::TimeDelta::FromMilliseconds(input[i].dwTime)); |
+ delegate_->HandleTouchEvent(event); |
+ } |
} |
} |
CloseTouchInputHandle(reinterpret_cast<HTOUCHINPUT>(l_param)); |