| 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_handler_wrapper.h" | 5 #include "blimp/client/core/input/blimp_input_handler_wrapper.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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 bool consumed = false; | 63 bool consumed = false; |
| 64 | 64 |
| 65 switch (disposition) { | 65 switch (disposition) { |
| 66 case ui::InputHandlerProxy::EventDisposition::DID_HANDLE: | 66 case ui::InputHandlerProxy::EventDisposition::DID_HANDLE: |
| 67 case ui::InputHandlerProxy::EventDisposition::DROP_EVENT: | 67 case ui::InputHandlerProxy::EventDisposition::DROP_EVENT: |
| 68 consumed = true; | 68 consumed = true; |
| 69 break; | 69 break; |
| 70 case ui::InputHandlerProxy::EventDisposition::DID_HANDLE_NON_BLOCKING: | 70 case ui::InputHandlerProxy::EventDisposition::DID_HANDLE_NON_BLOCKING: |
| 71 case ui::InputHandlerProxy::EventDisposition::DID_NOT_HANDLE: | 71 case ui::InputHandlerProxy::EventDisposition::DID_NOT_HANDLE: |
| 72 case ui::InputHandlerProxy::EventDisposition::DID_NOT_HANDLE_NON_BLOCKING: |
| 72 consumed = false; | 73 consumed = false; |
| 73 break; | 74 break; |
| 74 } | 75 } |
| 75 | 76 |
| 76 main_task_runner_->PostTask( | 77 main_task_runner_->PostTask( |
| 77 FROM_HERE, base::Bind(&BlimpInputManager::DidHandleWebGestureEvent, | 78 FROM_HERE, base::Bind(&BlimpInputManager::DidHandleWebGestureEvent, |
| 78 input_manager_weak_ptr_, gesture_event, consumed)); | 79 input_manager_weak_ptr_, gesture_event, consumed)); |
| 79 } | 80 } |
| 80 | 81 |
| 81 void BlimpInputHandlerWrapper::WillShutdown() { | 82 void BlimpInputHandlerWrapper::WillShutdown() { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 118 } |
| 118 | 119 |
| 119 void BlimpInputHandlerWrapper::DidOverscroll( | 120 void BlimpInputHandlerWrapper::DidOverscroll( |
| 120 const gfx::Vector2dF& accumulated_overscroll, | 121 const gfx::Vector2dF& accumulated_overscroll, |
| 121 const gfx::Vector2dF& latest_overscroll_delta, | 122 const gfx::Vector2dF& latest_overscroll_delta, |
| 122 const gfx::Vector2dF& current_fling_velocity, | 123 const gfx::Vector2dF& current_fling_velocity, |
| 123 const gfx::PointF& causal_event_viewport_point) { | 124 const gfx::PointF& causal_event_viewport_point) { |
| 124 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 125 DCHECK(compositor_thread_checker_.CalledOnValidThread()); |
| 125 } | 126 } |
| 126 | 127 |
| 127 void BlimpInputHandlerWrapper::DidStartFlinging() { | |
| 128 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | |
| 129 } | |
| 130 | |
| 131 void BlimpInputHandlerWrapper::DidStopFlinging() { | 128 void BlimpInputHandlerWrapper::DidStopFlinging() { |
| 132 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 129 DCHECK(compositor_thread_checker_.CalledOnValidThread()); |
| 133 } | 130 } |
| 134 | 131 |
| 135 void BlimpInputHandlerWrapper::DidAnimateForInput() { | 132 void BlimpInputHandlerWrapper::DidAnimateForInput() { |
| 136 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 133 DCHECK(compositor_thread_checker_.CalledOnValidThread()); |
| 137 } | 134 } |
| 138 | 135 |
| 139 void BlimpInputHandlerWrapper::InitOnCompositorThread( | 136 void BlimpInputHandlerWrapper::InitOnCompositorThread( |
| 140 cc::InputHandler* input_handler) { | 137 cc::InputHandler* input_handler) { |
| 141 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 138 DCHECK(compositor_thread_checker_.CalledOnValidThread()); |
| 142 | 139 |
| 143 input_handler_proxy_ = | 140 input_handler_proxy_ = |
| 144 base::MakeUnique<ui::InputHandlerProxy>(input_handler, this); | 141 base::MakeUnique<ui::InputHandlerProxy>(input_handler, this); |
| 145 main_task_runner_->PostTask( | 142 main_task_runner_->PostTask( |
| 146 FROM_HERE, | 143 FROM_HERE, |
| 147 base::Bind(&BlimpInputManager::OnInputHandlerWrapperInitialized, | 144 base::Bind(&BlimpInputManager::OnInputHandlerWrapperInitialized, |
| 148 input_manager_weak_ptr_, weak_factory_.GetWeakPtr())); | 145 input_manager_weak_ptr_, weak_factory_.GetWeakPtr())); |
| 149 } | 146 } |
| 150 | 147 |
| 151 } // namespace client | 148 } // namespace client |
| 152 } // namespace blimp | 149 } // namespace blimp |
| OLD | NEW |