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

Side by Side Diff: ash/common/wm/overview/cleanup_animation_observer.cc

Issue 2734653002: chromeos: Move files in //ash/common to //ash (Closed)
Patch Set: fix a11y tests, fix docs Created 3 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
(Empty)
1 // Copyright 2016 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 "ash/common/wm/overview/cleanup_animation_observer.h"
6
7 #include "ui/views/widget/widget.h"
8
9 namespace ash {
10
11 CleanupAnimationObserver::CleanupAnimationObserver(
12 std::unique_ptr<views::Widget> widget)
13 : widget_(std::move(widget)), owner_(nullptr) {
14 DCHECK(widget_);
15 }
16
17 CleanupAnimationObserver::~CleanupAnimationObserver() {}
18
19 void CleanupAnimationObserver::OnImplicitAnimationsCompleted() {
20 // |widget_| may get reset if Shutdown() is called prior to this method.
21 if (!widget_)
22 return;
23 if (owner_) {
24 owner_->RemoveAndDestroyAnimationObserver(this);
25 return;
26 }
27 delete this;
28 }
29
30 void CleanupAnimationObserver::SetOwner(WindowSelectorDelegate* owner) {
31 owner_ = owner;
32 }
33
34 void CleanupAnimationObserver::Shutdown() {
35 widget_.reset();
36 owner_ = nullptr;
37 }
38
39 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/overview/cleanup_animation_observer.h ('k') | ash/common/wm/overview/cleanup_animation_observer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698