| 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 "ash/wm/system_gesture_event_filter.h" | 5 #include "ash/wm/system_gesture_event_filter.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 if (event->type() == ui::ET_MOUSE_PRESSED && event->native_event() && | 65 if (event->type() == ui::ET_MOUSE_PRESSED && event->native_event() && |
| 66 ui::TouchFactory::GetInstance()->IsTouchDevicePresent() && | 66 ui::TouchFactory::GetInstance()->IsTouchDevicePresent() && |
| 67 Shell::GetInstance()->delegate()) { | 67 Shell::GetInstance()->delegate()) { |
| 68 Shell::GetInstance()->delegate()->RecordUserMetricsAction( | 68 Shell::GetInstance()->delegate()->RecordUserMetricsAction( |
| 69 UMA_MOUSE_DOWN); | 69 UMA_MOUSE_DOWN); |
| 70 } | 70 } |
| 71 #endif | 71 #endif |
| 72 return false; | 72 return false; |
| 73 } | 73 } |
| 74 | 74 |
| 75 ui::TouchStatus SystemGestureEventFilter::PreHandleTouchEvent( | 75 ui::EventResult SystemGestureEventFilter::PreHandleTouchEvent( |
| 76 aura::Window* target, | 76 aura::Window* target, |
| 77 ui::TouchEvent* event) { | 77 ui::TouchEvent* event) { |
| 78 touch_uma_.RecordTouchEvent(target, *event); | 78 touch_uma_.RecordTouchEvent(target, *event); |
| 79 long_press_affordance_->ProcessEvent(target, event, event->touch_id()); | 79 long_press_affordance_->ProcessEvent(target, event, event->touch_id()); |
| 80 return ui::TOUCH_STATUS_UNKNOWN; | 80 return ui::ER_UNHANDLED; |
| 81 } | 81 } |
| 82 | 82 |
| 83 ui::EventResult SystemGestureEventFilter::PreHandleGestureEvent( | 83 ui::EventResult SystemGestureEventFilter::PreHandleGestureEvent( |
| 84 aura::Window* target, | 84 aura::Window* target, |
| 85 ui::GestureEvent* event) { | 85 ui::GestureEvent* event) { |
| 86 touch_uma_.RecordGestureEvent(target, *event); | 86 touch_uma_.RecordGestureEvent(target, *event); |
| 87 long_press_affordance_->ProcessEvent(target, event, | 87 long_press_affordance_->ProcessEvent(target, event, |
| 88 event->GetLowestTouchId()); | 88 event->GetLowestTouchId()); |
| 89 | 89 |
| 90 if (!target || target == target->GetRootWindow()) { | 90 if (!target || target == target->GetRootWindow()) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 if (find == pinch_handlers_.end()) { | 162 if (find == pinch_handlers_.end()) { |
| 163 // The handler may have already been removed. | 163 // The handler may have already been removed. |
| 164 return; | 164 return; |
| 165 } | 165 } |
| 166 delete (*find).second; | 166 delete (*find).second; |
| 167 pinch_handlers_.erase(find); | 167 pinch_handlers_.erase(find); |
| 168 window->RemoveObserver(this); | 168 window->RemoveObserver(this); |
| 169 } | 169 } |
| 170 } // namespace internal | 170 } // namespace internal |
| 171 } // namespace ash | 171 } // namespace ash |
| OLD | NEW |