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

Unified Diff: win8/metro_driver/chrome_app_view_ash.cc

Issue 13003004: Support multi touch on Windows 8 AURA and ASH. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 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 | « ui/views/win/hwnd_message_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win8/metro_driver/chrome_app_view_ash.cc
===================================================================
--- win8/metro_driver/chrome_app_view_ash.cc (revision 189717)
+++ win8/metro_driver/chrome_app_view_ash.cc (working copy)
@@ -19,6 +19,7 @@
#include "ipc/ipc_channel.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_sender.h"
+#include "ui/base/gestures/gesture_sequence.h"
#include "ui/metro_viewer/metro_viewer_messages.h"
#include "win8/metro_driver/file_picker_ash.h"
#include "win8/metro_driver/metro_driver.h"
@@ -145,7 +146,8 @@
y_(0),
wheel_delta_(0),
update_kind_(winui::Input::PointerUpdateKind_Other),
- timestamp_(0) {}
+ timestamp_(0),
+ pointer_id_(0) {}
HRESULT Init(winui::Core::IPointerEventArgs* args) {
HRESULT hr = args->get_CurrentPoint(&pointer_point_);
@@ -169,10 +171,13 @@
hr = properties->get_MouseWheelDelta(&wheel_delta_);
if (FAILED(hr))
return hr;
-
x_ = point.X;
y_ = point.Y;
pointer_point_->get_Timestamp(&timestamp_);
+ pointer_point_->get_PointerId(&pointer_id_);
+ // Map the OS touch event id to a range allowed by the gesture recognizer.
+ if (IsTouch())
+ pointer_id_ %= ui::GestureSequence::kMaxGesturePoints;
return S_OK;
}
@@ -218,12 +223,17 @@
int x() const { return x_; }
int y() const { return y_; }
+ uint32 pointer_id() const {
+ return pointer_id_;
+ }
+
uint64 timestamp() const { return timestamp_; }
private:
int x_;
int y_;
int wheel_delta_;
+ uint32 pointer_id_;
winui::Input::PointerUpdateKind update_kind_;
mswr::ComPtr<winui::Input::IPointerPoint> pointer_point_;
uint64 timestamp_;
@@ -548,7 +558,8 @@
DCHECK(pointer.IsTouch());
ui_channel_->Send(new MetroViewerHostMsg_TouchMoved(pointer.x(),
pointer.y(),
- pointer.timestamp()));
+ pointer.timestamp(),
+ pointer.pointer_id()));
}
return S_OK;
}
@@ -577,7 +588,8 @@
DCHECK(pointer.IsTouch());
ui_channel_->Send(new MetroViewerHostMsg_TouchDown(pointer.x(),
pointer.y(),
- pointer.timestamp()));
+ pointer.timestamp(),
+ pointer.pointer_id()));
}
return S_OK;
}
@@ -601,7 +613,8 @@
DCHECK(pointer.IsTouch());
ui_channel_->Send(new MetroViewerHostMsg_TouchUp(pointer.x(),
pointer.y(),
- pointer.timestamp()));
+ pointer.timestamp(),
+ pointer.pointer_id()));
}
return S_OK;
}
« no previous file with comments | « ui/views/win/hwnd_message_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698