OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/android/in_process/synchronous_compositor_impl.h" | 5 #include "content/browser/android/in_process/synchronous_compositor_impl.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "cc/input/input_handler.h" | 9 #include "cc/input/input_handler.h" |
10 #include "cc/input/layer_scroll_offset_delegate.h" | 10 #include "cc/input/layer_scroll_offset_delegate.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 void SynchronousCompositorImpl::DidOverscroll( | 172 void SynchronousCompositorImpl::DidOverscroll( |
173 const cc::DidOverscrollParams& params) { | 173 const cc::DidOverscrollParams& params) { |
174 if (compositor_client_) { | 174 if (compositor_client_) { |
175 compositor_client_->DidOverscroll(params.accumulated_overscroll, | 175 compositor_client_->DidOverscroll(params.accumulated_overscroll, |
176 params.latest_overscroll_delta, | 176 params.latest_overscroll_delta, |
177 params.current_fling_velocity); | 177 params.current_fling_velocity); |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
| 181 void SynchronousCompositorImpl::DidStopFlinging() { |
| 182 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>( |
| 183 contents_->GetRenderWidgetHostView()); |
| 184 if (rwhv) |
| 185 rwhv->DidStopFlinging(); |
| 186 } |
| 187 |
181 void SynchronousCompositorImpl::SetContinuousInvalidate(bool enable) { | 188 void SynchronousCompositorImpl::SetContinuousInvalidate(bool enable) { |
182 DCHECK(CalledOnValidThread()); | 189 DCHECK(CalledOnValidThread()); |
183 if (compositor_client_) | 190 if (compositor_client_) |
184 compositor_client_->SetContinuousInvalidate(enable); | 191 compositor_client_->SetContinuousInvalidate(enable); |
185 } | 192 } |
186 | 193 |
187 InputEventAckState SynchronousCompositorImpl::HandleInputEvent( | 194 InputEventAckState SynchronousCompositorImpl::HandleInputEvent( |
188 const blink::WebInputEvent& input_event) { | 195 const blink::WebInputEvent& input_event) { |
189 DCHECK(CalledOnValidThread()); | 196 DCHECK(CalledOnValidThread()); |
190 return g_factory.Get().synchronous_input_event_filter()->HandleInputEvent( | 197 return g_factory.Get().synchronous_input_event_filter()->HandleInputEvent( |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 g_factory.Get(); // Ensure it's initialized. | 266 g_factory.Get(); // Ensure it's initialized. |
260 SynchronousCompositorImpl::CreateForWebContents(contents); | 267 SynchronousCompositorImpl::CreateForWebContents(contents); |
261 } | 268 } |
262 if (SynchronousCompositorImpl* instance = | 269 if (SynchronousCompositorImpl* instance = |
263 SynchronousCompositorImpl::FromWebContents(contents)) { | 270 SynchronousCompositorImpl::FromWebContents(contents)) { |
264 instance->SetClient(client); | 271 instance->SetClient(client); |
265 } | 272 } |
266 } | 273 } |
267 | 274 |
268 } // namespace content | 275 } // namespace content |
OLD | NEW |