| 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_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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 : LocatedEvent(model, source, target), | 314 : LocatedEvent(model, source, target), |
| 315 changed_button_flags_(model.changed_button_flags_) { | 315 changed_button_flags_(model.changed_button_flags_) { |
| 316 SetType(type); | 316 SetType(type); |
| 317 set_flags(flags); | 317 set_flags(flags); |
| 318 } | 318 } |
| 319 | 319 |
| 320 // Used for synthetic events in testing and by the gesture recognizer. | 320 // Used for synthetic events in testing and by the gesture recognizer. |
| 321 MouseEvent(EventType type, | 321 MouseEvent(EventType type, |
| 322 const gfx::Point& location, | 322 const gfx::Point& location, |
| 323 const gfx::Point& root_location, | 323 const gfx::Point& root_location, |
| 324 int flags); | 324 int flags, |
| 325 int changed_button_flags); |
| 325 | 326 |
| 326 // Conveniences to quickly test what button is down | 327 // Conveniences to quickly test what button is down |
| 327 bool IsOnlyLeftMouseButton() const { | 328 bool IsOnlyLeftMouseButton() const { |
| 328 return (flags() & EF_LEFT_MOUSE_BUTTON) && | 329 return (flags() & EF_LEFT_MOUSE_BUTTON) && |
| 329 !(flags() & (EF_MIDDLE_MOUSE_BUTTON | EF_RIGHT_MOUSE_BUTTON)); | 330 !(flags() & (EF_MIDDLE_MOUSE_BUTTON | EF_RIGHT_MOUSE_BUTTON)); |
| 330 } | 331 } |
| 331 | 332 |
| 332 bool IsLeftMouseButton() const { | 333 bool IsLeftMouseButton() const { |
| 333 return (flags() & EF_LEFT_MOUSE_BUTTON) != 0; | 334 return (flags() & EF_LEFT_MOUSE_BUTTON) != 0; |
| 334 } | 335 } |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 // The set of indices of ones in the binary representation of | 666 // The set of indices of ones in the binary representation of |
| 666 // touch_ids_bitfield_ is the set of touch_ids associate with this gesture. | 667 // touch_ids_bitfield_ is the set of touch_ids associate with this gesture. |
| 667 // This value is stored as a bitfield because the number of touch ids varies, | 668 // This value is stored as a bitfield because the number of touch ids varies, |
| 668 // but we currently don't need more than 32 touches at a time. | 669 // but we currently don't need more than 32 touches at a time. |
| 669 const unsigned int touch_ids_bitfield_; | 670 const unsigned int touch_ids_bitfield_; |
| 670 }; | 671 }; |
| 671 | 672 |
| 672 } // namespace ui | 673 } // namespace ui |
| 673 | 674 |
| 674 #endif // UI_EVENTS_EVENT_H_ | 675 #endif // UI_EVENTS_EVENT_H_ |
| OLD | NEW |