Chromium Code Reviews| Index: ui/aura/root_window.cc |
| diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc |
| index b47fc603aa5d79931699a0bfccfbdf49b5569bd9..7bb08b7f5bed45852336cb1a8318c64fdf5770b5 100644 |
| --- a/ui/aura/root_window.cc |
| +++ b/ui/aura/root_window.cc |
| @@ -116,6 +116,7 @@ RootWindow::RootWindow(const gfx::Rect& initial_bounds) |
| ALLOW_THIS_IN_INITIALIZER_LIST(schedule_paint_factory_(this)), |
| ALLOW_THIS_IN_INITIALIZER_LIST(event_factory_(this)), |
| mouse_button_flags_(0), |
| + touch_ids_down_(0), |
| last_cursor_(ui::kCursorNull), |
| cursor_shown_(true), |
| capture_window_(NULL), |
| @@ -308,6 +309,22 @@ bool RootWindow::DispatchScrollEvent(ScrollEvent* event) { |
| bool RootWindow::DispatchTouchEvent(TouchEvent* event) { |
| DispatchHeldMouseMove(); |
| + switch (event->type()) { |
| + case ui::ET_TOUCH_PRESSED: |
| + touch_ids_down_ |= (1 << event->touch_id()); |
| + Env::GetInstance()->set_touch_down(touch_ids_down_ != 0); |
| + break; |
| + |
| + case ui::ET_TOUCH_RELEASED: |
| + case ui::ET_TOUCH_CANCELLED: |
| + touch_ids_down_ = (touch_ids_down_ | (1 << event->touch_id())) ^ |
|
sadrul
2012/05/31 18:59:27
Does it make sense to have a DCHECK here for (touc
|
| + (1 << event->touch_id()); |
| + Env::GetInstance()->set_touch_down(touch_ids_down_ != 0); |
| + break; |
| + |
| + default: |
| + break; |
| + } |
| float scale = ui::GetDeviceScaleFactor(layer()); |
| ui::Transform transform = layer()->transform(); |
| transform.ConcatScale(scale, scale); |
| @@ -743,7 +760,9 @@ ui::GestureStatus RootWindow::ProcessGestureEvent(Window* target, |
| if (target->delegate()) |
| status = target->delegate()->OnGestureEvent(event); |
| - if (status == ui::GESTURE_STATUS_UNKNOWN) { |
| + if (status == ui::GESTURE_STATUS_UNKNOWN && |
| + !CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kAuraDisableMouseEventsFromTouch)) { |
| // The gesture was unprocessed. Generate corresponding mouse events here |
| // (e.g. tap to click). |
| const ui::EventType* types = NULL; |