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

Side by Side Diff: trunk/src/content/browser/renderer_host/ui_events_helper.cc

Issue 330613003: Revert 276728 "Fix slop region boundary handling." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/ui_events_helper.h" 5 #include "content/browser/renderer_host/ui_events_helper.h"
6 6
7 #include "content/common/input/web_touch_event_traits.h" 7 #include "content/common/input/web_touch_event_traits.h"
8 #include "third_party/WebKit/public/web/WebInputEvent.h" 8 #include "third_party/WebKit/public/web/WebInputEvent.h"
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/events/event_constants.h" 10 #include "ui/events/event_constants.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 if (point->state == blink::WebTouchPoint::StateMoved) { 307 if (point->state == blink::WebTouchPoint::StateMoved) {
308 // It is possible for badly written touch drivers to emit Move events even 308 // It is possible for badly written touch drivers to emit Move events even
309 // when the touch location hasn't changed. In such cases, consume the event 309 // when the touch location hasn't changed. In such cases, consume the event
310 // and pretend nothing happened. 310 // and pretend nothing happened.
311 if (point->position.x == event.x() && point->position.y == event.y()) 311 if (point->position.x == event.x() && point->position.y == event.y())
312 return NULL; 312 return NULL;
313 } 313 }
314 point->position.x = event.x(); 314 point->position.x = event.x();
315 point->position.y = event.y(); 315 point->position.y = event.y();
316 316
317 const gfx::PointF& root_point = event.root_location_f(); 317 const gfx::Point root_point = event.root_location();
318 point->screenPosition.x = root_point.x(); 318 point->screenPosition.x = root_point.x();
319 point->screenPosition.y = root_point.y(); 319 point->screenPosition.y = root_point.y();
320 320
321 // Mark the rest of the points as stationary. 321 // Mark the rest of the points as stationary.
322 for (unsigned i = 0; i < web_event->touchesLength; ++i) { 322 for (unsigned i = 0; i < web_event->touchesLength; ++i) {
323 blink::WebTouchPoint* iter = web_event->touches + i; 323 blink::WebTouchPoint* iter = web_event->touches + i;
324 if (iter != point) 324 if (iter != point)
325 iter->state = blink::WebTouchPoint::StateStationary; 325 iter->state = blink::WebTouchPoint::StateStationary;
326 } 326 }
327 327
328 // Update the type of the touch event. 328 // Update the type of the touch event.
329 WebTouchEventTraits::ResetType(TouchEventTypeFromEvent(event), 329 WebTouchEventTraits::ResetType(TouchEventTypeFromEvent(event),
330 event.time_stamp().InSecondsF(), 330 event.time_stamp().InSecondsF(),
331 web_event); 331 web_event);
332 web_event->modifiers = EventFlagsToWebEventModifiers(event.flags()); 332 web_event->modifiers = EventFlagsToWebEventModifiers(event.flags());
333 333
334 return point; 334 return point;
335 } 335 }
336 336
337 } // namespace content 337 } // namespace content
OLDNEW
« no previous file with comments | « trunk/src/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc ('k') | trunk/src/ui/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698