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

Unified Diff: win8/metro_driver/devices_handler.cc

Issue 11047012: Wiring metro mouse events to aura viewer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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 | « win8/metro_driver/devices_handler.h ('k') | win8/metro_driver/stdafx.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win8/metro_driver/devices_handler.cc
===================================================================
--- win8/metro_driver/devices_handler.cc (revision 160403)
+++ win8/metro_driver/devices_handler.cc (working copy)
@@ -20,4 +20,37 @@
return hr;
}
+PointerEventHandler::PointerEventHandler() {
+}
+
+PointerEventHandler::~PointerEventHandler() {
+}
+
+HRESULT PointerEventHandler::Init(winui::Core::IPointerEventArgs* args) {
+ mswr::ComPtr<winui::Input::IPointerPoint> pointer_point;
+ HRESULT hr = args->get_CurrentPoint(&pointer_point);
+ if (FAILED(hr))
+ return hr;
+
+ mswr::ComPtr<windevs::Input::IPointerDevice> pointer_device;
+ hr = pointer_point->get_PointerDevice(&pointer_device);
+ if (FAILED(hr))
+ return hr;
+
+ windevs::Input::PointerDeviceType device_type;
+ hr = pointer_device->get_PointerDeviceType(&device_type);
+ if (FAILED(hr))
+ return hr;
+
+ is_mouse_ = (device_type == windevs::Input::PointerDeviceType_Mouse);
+ winfoundtn::Point point;
+ hr = pointer_point->get_Position(&point);
+ if (FAILED(hr))
+ return hr;
+
+ x_ = point.X;
+ y_ = point.Y;
+ return S_OK;
+}
+
} // namespace metro_driver
« no previous file with comments | « win8/metro_driver/devices_handler.h ('k') | win8/metro_driver/stdafx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698