Home | History | Annotate | Download | only in compositor_bindings
      1 // Copyright 2014 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "content/renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.h"
      6 
      7 #include "third_party/WebKit/public/platform/WebAnimationDelegate.h"
      8 
      9 namespace content {
     10 
     11 WebToCCAnimationDelegateAdapter::WebToCCAnimationDelegateAdapter(
     12     blink::WebAnimationDelegate* delegate)
     13     : delegate_(delegate) {
     14 }
     15 
     16 void WebToCCAnimationDelegateAdapter::NotifyAnimationStarted(
     17     base::TimeTicks monotonic_time,
     18     cc::Animation::TargetProperty target_property) {
     19   delegate_->notifyAnimationStarted(
     20       (monotonic_time - base::TimeTicks()).InSecondsF(),
     21       static_cast<blink::WebAnimation::TargetProperty>(target_property));
     22 }
     23 
     24 void WebToCCAnimationDelegateAdapter::NotifyAnimationFinished(
     25     base::TimeTicks monotonic_time,
     26     cc::Animation::TargetProperty target_property) {
     27   delegate_->notifyAnimationFinished(
     28       (monotonic_time - base::TimeTicks()).InSecondsF(),
     29       static_cast<blink::WebAnimation::TargetProperty>(target_property));
     30 }
     31 
     32 }  // namespace content
     33 
     34