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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 consumed = false; | 72 consumed = false; |
73 break; | 73 break; |
74 default: | |
Wez
2016/11/07 22:54:07
This should explicitly catch the new enum, rather
lanwei
2016/11/07 23:25:18
Done.
| |
75 NOTREACHED(); | |
74 } | 76 } |
75 | 77 |
76 main_task_runner_->PostTask( | 78 main_task_runner_->PostTask( |
77 FROM_HERE, base::Bind(&BlimpInputManager::DidHandleWebGestureEvent, | 79 FROM_HERE, base::Bind(&BlimpInputManager::DidHandleWebGestureEvent, |
78 input_manager_weak_ptr_, gesture_event, consumed)); | 80 input_manager_weak_ptr_, gesture_event, consumed)); |
79 } | 81 } |
80 | 82 |
81 void BlimpInputHandlerWrapper::WillShutdown() { | 83 void BlimpInputHandlerWrapper::WillShutdown() { |
82 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 84 DCHECK(compositor_thread_checker_.CalledOnValidThread()); |
83 | 85 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 } | 119 } |
118 | 120 |
119 void BlimpInputHandlerWrapper::DidOverscroll( | 121 void BlimpInputHandlerWrapper::DidOverscroll( |
120 const gfx::Vector2dF& accumulated_overscroll, | 122 const gfx::Vector2dF& accumulated_overscroll, |
121 const gfx::Vector2dF& latest_overscroll_delta, | 123 const gfx::Vector2dF& latest_overscroll_delta, |
122 const gfx::Vector2dF& current_fling_velocity, | 124 const gfx::Vector2dF& current_fling_velocity, |
123 const gfx::PointF& causal_event_viewport_point) { | 125 const gfx::PointF& causal_event_viewport_point) { |
124 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 126 DCHECK(compositor_thread_checker_.CalledOnValidThread()); |
125 } | 127 } |
126 | 128 |
127 void BlimpInputHandlerWrapper::DidStartFlinging() { | |
128 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | |
129 } | |
130 | |
131 void BlimpInputHandlerWrapper::DidStopFlinging() { | 129 void BlimpInputHandlerWrapper::DidStopFlinging() { |
132 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 130 DCHECK(compositor_thread_checker_.CalledOnValidThread()); |
133 } | 131 } |
134 | 132 |
135 void BlimpInputHandlerWrapper::DidAnimateForInput() { | 133 void BlimpInputHandlerWrapper::DidAnimateForInput() { |
136 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 134 DCHECK(compositor_thread_checker_.CalledOnValidThread()); |
137 } | 135 } |
138 | 136 |
139 void BlimpInputHandlerWrapper::InitOnCompositorThread( | 137 void BlimpInputHandlerWrapper::InitOnCompositorThread( |
140 cc::InputHandler* input_handler) { | 138 cc::InputHandler* input_handler) { |
141 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 139 DCHECK(compositor_thread_checker_.CalledOnValidThread()); |
142 | 140 |
143 input_handler_proxy_ = | 141 input_handler_proxy_ = |
144 base::MakeUnique<ui::InputHandlerProxy>(input_handler, this); | 142 base::MakeUnique<ui::InputHandlerProxy>(input_handler, this); |
145 main_task_runner_->PostTask( | 143 main_task_runner_->PostTask( |
146 FROM_HERE, | 144 FROM_HERE, |
147 base::Bind(&BlimpInputManager::OnInputHandlerWrapperInitialized, | 145 base::Bind(&BlimpInputManager::OnInputHandlerWrapperInitialized, |
148 input_manager_weak_ptr_, weak_factory_.GetWeakPtr())); | 146 input_manager_weak_ptr_, weak_factory_.GetWeakPtr())); |
149 } | 147 } |
150 | 148 |
151 } // namespace client | 149 } // namespace client |
152 } // namespace blimp | 150 } // namespace blimp |
OLD | NEW |