OLD | NEW |
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_BASE_EVENTS_EVENT_H_ | 5 #ifndef UI_BASE_EVENTS_EVENT_H_ |
6 #define UI_BASE_EVENTS_EVENT_H_ | 6 #define UI_BASE_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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 public: | 574 public: |
575 explicit ScrollEvent(const base::NativeEvent& native_event); | 575 explicit ScrollEvent(const base::NativeEvent& native_event); |
576 template <class T> | 576 template <class T> |
577 ScrollEvent(const ScrollEvent& model, | 577 ScrollEvent(const ScrollEvent& model, |
578 T* source, | 578 T* source, |
579 T* target, | 579 T* target, |
580 EventType type, | 580 EventType type, |
581 int flags) | 581 int flags) |
582 : MouseEvent(model, source, target, type, flags), | 582 : MouseEvent(model, source, target, type, flags), |
583 x_offset_(model.x_offset_), | 583 x_offset_(model.x_offset_), |
584 y_offset_(model.y_offset_) { | 584 y_offset_(model.y_offset_), |
| 585 finger_count_(model.finger_count_){ |
585 } | 586 } |
586 | 587 |
587 // Used for tests. | 588 // Used for tests. |
588 ScrollEvent(EventType type, | 589 ScrollEvent(EventType type, |
589 const gfx::Point& location, | 590 const gfx::Point& location, |
590 int flags, | 591 int flags, |
591 float x_offset, | 592 float x_offset, |
592 float y_offset); | 593 float y_offset); |
593 | 594 |
594 float x_offset() const { return x_offset_; } | 595 float x_offset() const { return x_offset_; } |
595 float y_offset() const { return y_offset_; } | 596 float y_offset() const { return y_offset_; } |
| 597 int finger_count() const { return finger_count_; } |
596 | 598 |
597 private: | 599 private: |
598 float x_offset_; | 600 float x_offset_; |
599 float y_offset_; | 601 float y_offset_; |
| 602 int finger_count_; |
600 | 603 |
601 DISALLOW_COPY_AND_ASSIGN(ScrollEvent); | 604 DISALLOW_COPY_AND_ASSIGN(ScrollEvent); |
602 }; | 605 }; |
603 | 606 |
604 class UI_EXPORT GestureEvent : public LocatedEvent { | 607 class UI_EXPORT GestureEvent : public LocatedEvent { |
605 public: | 608 public: |
606 GestureEvent(EventType type, | 609 GestureEvent(EventType type, |
607 int x, | 610 int x, |
608 int y, | 611 int y, |
609 int flags, | 612 int flags, |
(...skipping 27 matching lines...) Expand all Loading... |
637 // This value is stored as a bitfield because the number of touch ids varies, | 640 // This value is stored as a bitfield because the number of touch ids varies, |
638 // but we currently don't need more than 32 touches at a time. | 641 // but we currently don't need more than 32 touches at a time. |
639 const unsigned int touch_ids_bitfield_; | 642 const unsigned int touch_ids_bitfield_; |
640 | 643 |
641 DISALLOW_COPY_AND_ASSIGN(GestureEvent); | 644 DISALLOW_COPY_AND_ASSIGN(GestureEvent); |
642 }; | 645 }; |
643 | 646 |
644 } // namespace ui | 647 } // namespace ui |
645 | 648 |
646 #endif // UI_BASE_EVENTS_EVENT_H_ | 649 #endif // UI_BASE_EVENTS_EVENT_H_ |
OLD | NEW |