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

Side by Side Diff: ui/events/event.h

Issue 800163005: Fixed ui::TouchEvent rotation angle out-of-bound issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed few unsed setters from ui::TouchEvent Created 5 years, 11 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
« no previous file with comments | « no previous file | ui/events/event.cc » ('j') | ui/events/event.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef UI_EVENTS_EVENT_H_ 5 #ifndef UI_EVENTS_EVENT_H_
6 #define UI_EVENTS_EVENT_H_ 6 #define UI_EVENTS_EVENT_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/event_types.h" 10 #include "base/event_types.h"
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 // Overridden from LocatedEvent. 535 // Overridden from LocatedEvent.
536 void UpdateForRootTransform( 536 void UpdateForRootTransform(
537 const gfx::Transform& inverted_root_transform) override; 537 const gfx::Transform& inverted_root_transform) override;
538 538
539 // Marks the event as not participating in synchronous gesture recognition. 539 // Marks the event as not participating in synchronous gesture recognition.
540 void DisableSynchronousHandling(); 540 void DisableSynchronousHandling();
541 bool synchronous_handling_disabled() const { 541 bool synchronous_handling_disabled() const {
542 return !!(result() & ER_DISABLE_SYNC_HANDLING); 542 return !!(result() & ER_DISABLE_SYNC_HANDLING);
543 } 543 }
544 544
545 protected:
546 void set_radius(float radius_x, float radius_y) {
547 radius_x_ = radius_x;
548 radius_y_ = radius_y;
549 }
550
551 void set_rotation_angle(float rotation_angle) {
552 rotation_angle_ = rotation_angle;
553 }
554
555 void set_force(float force) { force_ = force; }
556
557 private: 545 private:
558 // The identity (typically finger) of the touch starting at 0 and incrementing 546 // The identity (typically finger) of the touch starting at 0 and incrementing
559 // for each separable additional touch that the hardware can detect. 547 // for each separable additional touch that the hardware can detect.
560 const int touch_id_; 548 const int touch_id_;
561 549
562 // A unique identifier for the touch event. 550 // A unique identifier for the touch event.
563 const uint64 unique_event_id_; 551 const uint64 unique_event_id_;
564 552
565 // Radius of the X (major) axis of the touch ellipse. 0.0 if unknown. 553 // Radius of the X (major) axis of the touch ellipse. 0.0 if unknown.
tdresser 2015/01/20 13:36:39 Sometime we should consider renaming to radius_maj
mustaq 2015/01/20 16:26:46 I think radius_x makes more sense here. We can hav
tdresser 2015/01/20 16:40:38 Acknowledged.
566 float radius_x_; 554 float radius_x_;
567 555
568 // Radius of the Y (minor) axis of the touch ellipse. 0.0 if unknown. 556 // Radius of the Y (minor) axis of the touch ellipse. 0.0 if unknown.
569 float radius_y_; 557 float radius_y_;
570 558
571 // Angle of the major axis away from the X axis. Default 0.0. 559 // Clockwise angle (in degrees) of the major axis from the X axis. Must be
560 // within [-90, 90].
572 float rotation_angle_; 561 float rotation_angle_;
573 562
574 // Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0. 563 // Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0.
575 float force_; 564 float force_;
576 565
577 // Whether the (unhandled) touch event will produce a scroll event (e.g., a 566 // Whether the (unhandled) touch event will produce a scroll event (e.g., a
578 // touchmove that exceeds the platform slop region, or a touchend that 567 // touchmove that exceeds the platform slop region, or a touchend that
579 // causes a fling). Defaults to false. 568 // causes a fling). Defaults to false.
580 bool may_cause_scrolling_; 569 bool may_cause_scrolling_;
570
571 // Adjusts rotation_angle_ to within the acceptable range.
572 void fixRotationAngle();
581 }; 573 };
582 574
583 // An interface that individual platforms can use to store additional data on 575 // An interface that individual platforms can use to store additional data on
584 // KeyEvent. 576 // KeyEvent.
585 // 577 //
586 // Currently only used in mojo. 578 // Currently only used in mojo.
587 class EVENTS_EXPORT ExtendedKeyEventData { 579 class EVENTS_EXPORT ExtendedKeyEventData {
588 public: 580 public:
589 virtual ~ExtendedKeyEventData() {} 581 virtual ~ExtendedKeyEventData() {}
590 582
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 865
874 const GestureEventDetails& details() const { return details_; } 866 const GestureEventDetails& details() const { return details_; }
875 867
876 private: 868 private:
877 GestureEventDetails details_; 869 GestureEventDetails details_;
878 }; 870 };
879 871
880 } // namespace ui 872 } // namespace ui
881 873
882 #endif // UI_EVENTS_EVENT_H_ 874 #endif // UI_EVENTS_EVENT_H_
OLDNEW
« no previous file with comments | « no previous file | ui/events/event.cc » ('j') | ui/events/event.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698