Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: content/browser/android/in_process/synchronous_compositor_impl.cc

Issue 274323004: NOT FOR LANDING - [WebView] Allow fling animation via the LayerScrollOffsetDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 return gfx::ScrollOffset(); 325 return gfx::ScrollOffset();
326 } 326 }
327 327
328 bool SynchronousCompositorImpl::IsExternalFlingActive() const { 328 bool SynchronousCompositorImpl::IsExternalFlingActive() const {
329 DCHECK(CalledOnValidThread()); 329 DCHECK(CalledOnValidThread());
330 if (compositor_client_) 330 if (compositor_client_)
331 return compositor_client_->IsExternalFlingActive(); 331 return compositor_client_->IsExternalFlingActive();
332 return false; 332 return false;
333 } 333 }
334 334
335 void SynchronousCompositorImpl::SetNeedsAnimate(
336 const AnimationCallback& animation) {
337 DCHECK(CalledOnValidThread());
338 if (compositor_client_)
339 compositor_client_->SetNeedsAnimateFling(animation);
340 }
341
335 void SynchronousCompositorImpl::UpdateRootLayerState( 342 void SynchronousCompositorImpl::UpdateRootLayerState(
336 const gfx::ScrollOffset& total_scroll_offset, 343 const gfx::ScrollOffset& total_scroll_offset,
337 const gfx::ScrollOffset& max_scroll_offset, 344 const gfx::ScrollOffset& max_scroll_offset,
338 const gfx::SizeF& scrollable_size, 345 const gfx::SizeF& scrollable_size,
339 float page_scale_factor, 346 float page_scale_factor,
340 float min_page_scale_factor, 347 float min_page_scale_factor,
341 float max_page_scale_factor) { 348 float max_page_scale_factor) {
342 DCHECK(CalledOnValidThread()); 349 DCHECK(CalledOnValidThread());
343 if (!compositor_client_) 350 if (!compositor_client_)
344 return; 351 return;
(...skipping 23 matching lines...) Expand all
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698