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

Unified Diff: components/html_viewer/touch_handler.cc

Issue 1313353010: Overhaul Mandoline event transport code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 5 years, 3 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 | « components/html_viewer/blink_input_events_type_converters.cc ('k') | components/pdf_viewer/pdf_viewer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/html_viewer/touch_handler.cc
diff --git a/components/html_viewer/touch_handler.cc b/components/html_viewer/touch_handler.cc
index 4764867eb15e7dc7be50c8f2100b61d494d0311d..3d7d96bf3cfedc533b13772827a4a8aed50fb324 100644
--- a/components/html_viewer/touch_handler.cc
+++ b/components/html_viewer/touch_handler.cc
@@ -15,6 +15,8 @@
namespace html_viewer {
namespace {
+// TODO(rjkroege): Gesture recognition currently happens in the html_viewer.
+// In phase2, it will be relocated to MUS. Update this code at that time.
void SetPropertiesFromEvent(const mojo::Event& event,
ui::PointerProperties* properties) {
properties->id = event.pointer_data->pointer_id;
@@ -22,10 +24,20 @@ void SetPropertiesFromEvent(const mojo::Event& event,
properties->y = event.pointer_data->y;
properties->raw_x = event.pointer_data->screen_x;
properties->raw_y = event.pointer_data->screen_y;
- properties->pressure = event.pointer_data->pressure;
- properties->SetAxesAndOrientation(event.pointer_data->radius_major,
- event.pointer_data->radius_minor,
- event.pointer_data->orientation);
+
+ if (event.pointer_data->kind == mojo::POINTER_KIND_TOUCH ||
+ event.pointer_data->kind == mojo::POINTER_KIND_PEN) {
+ properties->pressure = event.pointer_data->brush_data->pressure;
+
+ // TODO(rjkroege): vary orientation for width, height.
+ properties->SetAxesAndOrientation(event.pointer_data->brush_data->width,
+ event.pointer_data->brush_data->height,
+ 0.0);
+ } else {
+ // TODO(rjkroege): This might need to .5 when the button is down to
+ // satisfy the Pointer events specification.
+ properties->pressure = 0.0;
sadrul 2015/09/10 17:39:15 We can look at (event.flags | EVENT_FLAGS_LEFT_MOU
rjkroege 2015/09/12 01:29:02 Done.
+ }
// TODO(sky): Add support for tool_type.
}
« no previous file with comments | « components/html_viewer/blink_input_events_type_converters.cc ('k') | components/pdf_viewer/pdf_viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698