Index: ui/aura/window_event_dispatcher.cc |
diff --git a/ui/aura/window_event_dispatcher.cc b/ui/aura/window_event_dispatcher.cc |
index 8b7db5d1eb1ec68d96d3cbcaee170b8c5cfee7f4..bad218f5b115734ea00852a597ea10339d8ddd48 100644 |
--- a/ui/aura/window_event_dispatcher.cc |
+++ b/ui/aura/window_event_dispatcher.cc |
@@ -75,7 +75,6 @@ bool IsEventCandidateForHold(const ui::Event& event) { |
WindowEventDispatcher::WindowEventDispatcher(WindowTreeHost* host) |
: host_(host), |
- touch_ids_down_(0), |
mouse_pressed_handler_(NULL), |
mouse_moved_handler_(NULL), |
event_dispatch_target_(NULL), |
@@ -853,8 +852,8 @@ void WindowEventDispatcher::PreDispatchTouchEvent(Window* target, |
ui::TouchEvent* event) { |
switch (event->type()) { |
case ui::ET_TOUCH_PRESSED: |
- touch_ids_down_ |= (1 << event->touch_id()); |
- Env::GetInstance()->set_touch_down(touch_ids_down_ != 0); |
+ touch_ids_down_.insert(event->touch_id()); |
+ Env::GetInstance()->set_touch_down(!touch_ids_down_.empty()); |
break; |
// Handle ET_TOUCH_CANCELLED only if it has a native event. |
@@ -863,9 +862,8 @@ void WindowEventDispatcher::PreDispatchTouchEvent(Window* target, |
break; |
// fallthrough |
case ui::ET_TOUCH_RELEASED: |
- touch_ids_down_ = (touch_ids_down_ | (1 << event->touch_id())) ^ |
- (1 << event->touch_id()); |
- Env::GetInstance()->set_touch_down(touch_ids_down_ != 0); |
+ touch_ids_down_.erase(event->touch_id()); |
+ Env::GetInstance()->set_touch_down(!touch_ids_down_.empty()); |
break; |
case ui::ET_TOUCH_MOVED: |