OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "ash/wm/overview/window_grid.h" | 5 #include "ash/wm/overview/window_grid.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 26 matching lines...) Expand all Loading... |
37 namespace { | 37 namespace { |
38 | 38 |
39 typedef std::vector<aura::Window*> Windows; | 39 typedef std::vector<aura::Window*> Windows; |
40 | 40 |
41 // An observer which holds onto the passed widget until the animation is | 41 // An observer which holds onto the passed widget until the animation is |
42 // complete. | 42 // complete. |
43 class CleanupWidgetAfterAnimationObserver | 43 class CleanupWidgetAfterAnimationObserver |
44 : public ui::ImplicitAnimationObserver { | 44 : public ui::ImplicitAnimationObserver { |
45 public: | 45 public: |
46 explicit CleanupWidgetAfterAnimationObserver( | 46 explicit CleanupWidgetAfterAnimationObserver( |
47 scoped_ptr<views::Widget> widget); | 47 std::unique_ptr<views::Widget> widget); |
48 ~CleanupWidgetAfterAnimationObserver() override; | 48 ~CleanupWidgetAfterAnimationObserver() override; |
49 | 49 |
50 // ui::ImplicitAnimationObserver: | 50 // ui::ImplicitAnimationObserver: |
51 void OnImplicitAnimationsCompleted() override; | 51 void OnImplicitAnimationsCompleted() override; |
52 | 52 |
53 private: | 53 private: |
54 scoped_ptr<views::Widget> widget_; | 54 std::unique_ptr<views::Widget> widget_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(CleanupWidgetAfterAnimationObserver); | 56 DISALLOW_COPY_AND_ASSIGN(CleanupWidgetAfterAnimationObserver); |
57 }; | 57 }; |
58 | 58 |
59 CleanupWidgetAfterAnimationObserver::CleanupWidgetAfterAnimationObserver( | 59 CleanupWidgetAfterAnimationObserver::CleanupWidgetAfterAnimationObserver( |
60 scoped_ptr<views::Widget> widget) | 60 std::unique_ptr<views::Widget> widget) |
61 : widget_(std::move(widget)) {} | 61 : widget_(std::move(widget)) {} |
62 | 62 |
63 CleanupWidgetAfterAnimationObserver::~CleanupWidgetAfterAnimationObserver() { | 63 CleanupWidgetAfterAnimationObserver::~CleanupWidgetAfterAnimationObserver() { |
64 } | 64 } |
65 | 65 |
66 void CleanupWidgetAfterAnimationObserver::OnImplicitAnimationsCompleted() { | 66 void CleanupWidgetAfterAnimationObserver::OnImplicitAnimationsCompleted() { |
67 delete this; | 67 delete this; |
68 } | 68 } |
69 | 69 |
70 // A comparator for locating a given target window. | 70 // A comparator for locating a given target window. |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); | 506 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
507 selection_widget_->SetBounds(SelectedWindow()->target_bounds()); | 507 selection_widget_->SetBounds(SelectedWindow()->target_bounds()); |
508 selection_widget_->SetOpacity(255); | 508 selection_widget_->SetOpacity(255); |
509 return; | 509 return; |
510 } | 510 } |
511 selection_widget_->SetBounds(SelectedWindow()->target_bounds()); | 511 selection_widget_->SetBounds(SelectedWindow()->target_bounds()); |
512 selection_widget_->SetOpacity(255); | 512 selection_widget_->SetOpacity(255); |
513 } | 513 } |
514 | 514 |
515 } // namespace ash | 515 } // namespace ash |
OLD | NEW |