| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/client/core/input/blimp_input_manager.h" | 5 #include "blimp/client/core/input/blimp_input_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "blimp/client/core/input/blimp_input_handler_wrapper.h" | 10 #include "blimp/client/core/input/blimp_input_handler_wrapper.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 void BlimpInputManager::OnGestureEvent(const ui::GestureEventData& gesture) { | 73 void BlimpInputManager::OnGestureEvent(const ui::GestureEventData& gesture) { |
| 74 DCHECK(thread_checker_.CalledOnValidThread()); | 74 DCHECK(thread_checker_.CalledOnValidThread()); |
| 75 | 75 |
| 76 blink::WebGestureEvent web_gesture = | 76 blink::WebGestureEvent web_gesture = |
| 77 ui::CreateWebGestureEventFromGestureEventData(gesture); | 77 ui::CreateWebGestureEventFromGestureEventData(gesture); |
| 78 // TODO(khushalsagar): Remove this workaround after Android fixes UiAutomator | 78 // TODO(khushalsagar): Remove this workaround after Android fixes UiAutomator |
| 79 // to stop providing shift meta values to synthetic MotionEvents. This | 79 // to stop providing shift meta values to synthetic MotionEvents. This |
| 80 // prevents unintended shift+click interpretation of all accessibility clicks. | 80 // prevents unintended shift+click interpretation of all accessibility clicks. |
| 81 // See crbug.com/443247. | 81 // See crbug.com/443247. |
| 82 if (web_gesture.type == blink::WebInputEvent::GestureTap && | 82 if (web_gesture.type() == blink::WebInputEvent::GestureTap && |
| 83 web_gesture.modifiers == blink::WebInputEvent::ShiftKey) { | 83 web_gesture.modifiers() == blink::WebInputEvent::ShiftKey) { |
| 84 web_gesture.setModifiers(blink::WebInputEvent::NoModifiers); | 84 web_gesture.setModifiers(blink::WebInputEvent::NoModifiers); |
| 85 } | 85 } |
| 86 | 86 |
| 87 compositor_task_runner_->PostTask( | 87 compositor_task_runner_->PostTask( |
| 88 FROM_HERE, base::Bind(&BlimpInputHandlerWrapper::HandleWebGestureEvent, | 88 FROM_HERE, base::Bind(&BlimpInputHandlerWrapper::HandleWebGestureEvent, |
| 89 input_handler_wrapper_weak_ptr_, web_gesture)); | 89 input_handler_wrapper_weak_ptr_, web_gesture)); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void BlimpInputManager::DidHandleWebGestureEvent( | 92 void BlimpInputManager::DidHandleWebGestureEvent( |
| 93 const blink::WebGestureEvent& gesture_event, | 93 const blink::WebGestureEvent& gesture_event, |
| 94 bool consumed) { | 94 bool consumed) { |
| 95 DCHECK(thread_checker_.CalledOnValidThread()); | 95 DCHECK(thread_checker_.CalledOnValidThread()); |
| 96 | 96 |
| 97 if (!consumed) | 97 if (!consumed) |
| 98 client_->SendWebGestureEvent(gesture_event); | 98 client_->SendWebGestureEvent(gesture_event); |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace client | 101 } // namespace client |
| 102 } // namespace blimp | 102 } // namespace blimp |
| OLD | NEW |