| 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 DCHECK(CalledOnValidThread()); | 346 DCHECK(CalledOnValidThread()); |
| 347 DCHECK(compositor_client_); | 347 DCHECK(compositor_client_); |
| 348 if (!registered_with_client_) | 348 if (!registered_with_client_) |
| 349 return gfx::ScrollOffset(); | 349 return gfx::ScrollOffset(); |
| 350 // TODO(miletus): Make GetTotalRootLayerScrollOffset return | 350 // TODO(miletus): Make GetTotalRootLayerScrollOffset return |
| 351 // ScrollOffset. crbug.com/414283. | 351 // ScrollOffset. crbug.com/414283. |
| 352 return gfx::ScrollOffset( | 352 return gfx::ScrollOffset( |
| 353 compositor_client_->GetTotalRootLayerScrollOffset()); | 353 compositor_client_->GetTotalRootLayerScrollOffset()); |
| 354 } | 354 } |
| 355 | 355 |
| 356 bool SynchronousCompositorImpl::IsExternalScrollActive() const { | |
| 357 DCHECK(CalledOnValidThread()); | |
| 358 DCHECK(compositor_client_); | |
| 359 if (!registered_with_client_) | |
| 360 return false; | |
| 361 return compositor_client_->IsExternalScrollActive(); | |
| 362 } | |
| 363 | |
| 364 void SynchronousCompositorImpl::SetNeedsAnimate( | 356 void SynchronousCompositorImpl::SetNeedsAnimate( |
| 365 const AnimationCallback& animation) { | 357 const AnimationCallback& animation) { |
| 366 DCHECK(CalledOnValidThread()); | 358 DCHECK(CalledOnValidThread()); |
| 367 DCHECK(compositor_client_); | 359 DCHECK(compositor_client_); |
| 368 if (!registered_with_client_) | 360 if (!registered_with_client_) |
| 369 return; | 361 return; |
| 370 compositor_client_->SetNeedsAnimateScroll(animation); | 362 compositor_client_->SetNeedsAnimateScroll(animation); |
| 371 } | 363 } |
| 372 | 364 |
| 373 void SynchronousCompositorImpl::UpdateRootLayerState( | 365 void SynchronousCompositorImpl::UpdateRootLayerState( |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 g_factory.Get(); // Ensure it's initialized. | 399 g_factory.Get(); // Ensure it's initialized. |
| 408 SynchronousCompositorImpl::CreateForWebContents(contents); | 400 SynchronousCompositorImpl::CreateForWebContents(contents); |
| 409 } | 401 } |
| 410 SynchronousCompositorImpl* instance = | 402 SynchronousCompositorImpl* instance = |
| 411 SynchronousCompositorImpl::FromWebContents(contents); | 403 SynchronousCompositorImpl::FromWebContents(contents); |
| 412 DCHECK(instance); | 404 DCHECK(instance); |
| 413 instance->SetClient(client); | 405 instance->SetClient(client); |
| 414 } | 406 } |
| 415 | 407 |
| 416 } // namespace content | 408 } // namespace content |
| OLD | NEW |