closure_animation_observer.cc 576 B

12345678910111213141516171819202122
  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. #include "ui/compositor/closure_animation_observer.h"
  5. namespace ui {
  6. ClosureAnimationObserver::ClosureAnimationObserver(base::OnceClosure closure)
  7. : closure_(std::move(closure)) {
  8. DCHECK(!closure_.is_null());
  9. }
  10. ClosureAnimationObserver::~ClosureAnimationObserver() {
  11. }
  12. void ClosureAnimationObserver::OnImplicitAnimationsCompleted() {
  13. std::move(closure_).Run();
  14. delete this;
  15. }
  16. } // namespace ui