| 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/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 320 |
| 321 gfx::ScrollOffset SynchronousCompositorImpl::GetTotalScrollOffset() { | 321 gfx::ScrollOffset SynchronousCompositorImpl::GetTotalScrollOffset() { |
| 322 DCHECK(CalledOnValidThread()); | 322 DCHECK(CalledOnValidThread()); |
| 323 DCHECK(compositor_client_); | 323 DCHECK(compositor_client_); |
| 324 // TODO(miletus): Make GetTotalRootLayerScrollOffset return | 324 // TODO(miletus): Make GetTotalRootLayerScrollOffset return |
| 325 // ScrollOffset. crbug.com/414283. | 325 // ScrollOffset. crbug.com/414283. |
| 326 return gfx::ScrollOffset( | 326 return gfx::ScrollOffset( |
| 327 compositor_client_->GetTotalRootLayerScrollOffset()); | 327 compositor_client_->GetTotalRootLayerScrollOffset()); |
| 328 } | 328 } |
| 329 | 329 |
| 330 bool SynchronousCompositorImpl::IsExternalFlingActive() const { | 330 bool SynchronousCompositorImpl::IsExternalScrollActive() const { |
| 331 DCHECK(CalledOnValidThread()); | 331 DCHECK(CalledOnValidThread()); |
| 332 DCHECK(compositor_client_); | 332 DCHECK(compositor_client_); |
| 333 return compositor_client_->IsExternalFlingActive(); | 333 return compositor_client_->IsExternalScrollActive(); |
| 334 } |
| 335 |
| 336 void SynchronousCompositorImpl::SetNeedsAnimate( |
| 337 const AnimationCallback& animation) { |
| 338 DCHECK(CalledOnValidThread()); |
| 339 if (compositor_client_) |
| 340 compositor_client_->SetNeedsAnimateScroll(animation); |
| 334 } | 341 } |
| 335 | 342 |
| 336 void SynchronousCompositorImpl::UpdateRootLayerState( | 343 void SynchronousCompositorImpl::UpdateRootLayerState( |
| 337 const gfx::ScrollOffset& total_scroll_offset, | 344 const gfx::ScrollOffset& total_scroll_offset, |
| 338 const gfx::ScrollOffset& max_scroll_offset, | 345 const gfx::ScrollOffset& max_scroll_offset, |
| 339 const gfx::SizeF& scrollable_size, | 346 const gfx::SizeF& scrollable_size, |
| 340 float page_scale_factor, | 347 float page_scale_factor, |
| 341 float min_page_scale_factor, | 348 float min_page_scale_factor, |
| 342 float max_page_scale_factor) { | 349 float max_page_scale_factor) { |
| 343 DCHECK(CalledOnValidThread()); | 350 DCHECK(CalledOnValidThread()); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 368 g_factory.Get(); // Ensure it's initialized. | 375 g_factory.Get(); // Ensure it's initialized. |
| 369 SynchronousCompositorImpl::CreateForWebContents(contents); | 376 SynchronousCompositorImpl::CreateForWebContents(contents); |
| 370 } | 377 } |
| 371 SynchronousCompositorImpl* instance = | 378 SynchronousCompositorImpl* instance = |
| 372 SynchronousCompositorImpl::FromWebContents(contents); | 379 SynchronousCompositorImpl::FromWebContents(contents); |
| 373 DCHECK(instance); | 380 DCHECK(instance); |
| 374 instance->SetClient(client); | 381 instance->SetClient(client); |
| 375 } | 382 } |
| 376 | 383 |
| 377 } // namespace content | 384 } // namespace content |
| OLD | NEW |