| 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 #include "ui/base/events/event.h" | 5 #include "ui/base/events/event.h" |
| 6 | 6 |
| 7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 #endif | 65 #endif |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool Event::HasNativeEvent() const { | 68 bool Event::HasNativeEvent() const { |
| 69 base::NativeEvent null_event; | 69 base::NativeEvent null_event; |
| 70 std::memset(&null_event, 0, sizeof(null_event)); | 70 std::memset(&null_event, 0, sizeof(null_event)); |
| 71 return !!std::memcmp(&native_event_, &null_event, sizeof(null_event)); | 71 return !!std::memcmp(&native_event_, &null_event, sizeof(null_event)); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void Event::StopPropagation() { | 74 void Event::StopPropagation() { |
| 75 CHECK(phase_ != EP_PREDISPATCH && phase_ != EP_POSTDISPATCH); | 75 // CHECK(phase_ != EP_PREDISPATCH && phase_ != EP_POSTDISPATCH); |
| 76 result_ = static_cast<ui::EventResult>(result_ | ER_CONSUMED); | 76 result_ = static_cast<ui::EventResult>(result_ | ER_CONSUMED); |
| 77 CHECK(stopped_propagation()); | 77 CHECK(stopped_propagation()); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void Event::SetHandled() { | 80 void Event::SetHandled() { |
| 81 CHECK(phase_ != EP_PREDISPATCH && phase_ != EP_POSTDISPATCH); | 81 // CHECK(phase_ != EP_PREDISPATCH && phase_ != EP_POSTDISPATCH); |
| 82 result_ = static_cast<ui::EventResult>(result_ | ER_HANDLED); | 82 result_ = static_cast<ui::EventResult>(result_ | ER_HANDLED); |
| 83 } | 83 } |
| 84 | 84 |
| 85 Event::Event(EventType type, base::TimeDelta time_stamp, int flags) | 85 Event::Event(EventType type, base::TimeDelta time_stamp, int flags) |
| 86 : type_(type), | 86 : type_(type), |
| 87 time_stamp_(time_stamp), | 87 time_stamp_(time_stamp), |
| 88 flags_(flags), | 88 flags_(flags), |
| 89 delete_native_event_(false), | 89 delete_native_event_(false), |
| 90 target_(NULL), | 90 target_(NULL), |
| 91 phase_(EP_PREDISPATCH), | 91 phase_(EP_PREDISPATCH), |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 int GestureEvent::GetLowestTouchId() const { | 563 int GestureEvent::GetLowestTouchId() const { |
| 564 if (touch_ids_bitfield_ == 0) | 564 if (touch_ids_bitfield_ == 0) |
| 565 return -1; | 565 return -1; |
| 566 int i = -1; | 566 int i = -1; |
| 567 // Find the index of the least significant 1 bit | 567 // Find the index of the least significant 1 bit |
| 568 while (!(1 << ++i & touch_ids_bitfield_)); | 568 while (!(1 << ++i & touch_ids_bitfield_)); |
| 569 return i; | 569 return i; |
| 570 } | 570 } |
| 571 | 571 |
| 572 } // namespace ui | 572 } // namespace ui |
| OLD | NEW |