OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/test/shelf_view_test_api.h" | 5 #include "ash/test/shelf_view_test_api.h" |
6 | 6 |
7 #include "ash/shelf/overflow_button.h" | 7 #include "ash/shelf/overflow_button.h" |
8 #include "ash/shelf/shelf_button.h" | 8 #include "ash/shelf/shelf_button.h" |
9 #include "ash/shelf/shelf_constants.h" | 9 #include "ash/shelf/shelf_constants.h" |
10 #include "ash/shelf/shelf_model.h" | 10 #include "ash/shelf/shelf_model.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 80 } |
81 | 81 |
82 void ShelfViewTestAPI::SetAnimationDuration(int duration_ms) { | 82 void ShelfViewTestAPI::SetAnimationDuration(int duration_ms) { |
83 shelf_view_->bounds_animator_->SetAnimationDuration(duration_ms); | 83 shelf_view_->bounds_animator_->SetAnimationDuration(duration_ms); |
84 } | 84 } |
85 | 85 |
86 void ShelfViewTestAPI::RunMessageLoopUntilAnimationsDone() { | 86 void ShelfViewTestAPI::RunMessageLoopUntilAnimationsDone() { |
87 if (!shelf_view_->bounds_animator_->IsAnimating()) | 87 if (!shelf_view_->bounds_animator_->IsAnimating()) |
88 return; | 88 return; |
89 | 89 |
90 scoped_ptr<TestAPIAnimationObserver> observer(new TestAPIAnimationObserver()); | 90 std::unique_ptr<TestAPIAnimationObserver> observer( |
| 91 new TestAPIAnimationObserver()); |
91 shelf_view_->bounds_animator_->AddObserver(observer.get()); | 92 shelf_view_->bounds_animator_->AddObserver(observer.get()); |
92 | 93 |
93 // This nested loop will quit when TestAPIAnimationObserver's | 94 // This nested loop will quit when TestAPIAnimationObserver's |
94 // OnBoundsAnimatorDone is called. | 95 // OnBoundsAnimatorDone is called. |
95 base::MessageLoop::current()->Run(); | 96 base::MessageLoop::current()->Run(); |
96 | 97 |
97 shelf_view_->bounds_animator_->RemoveObserver(observer.get()); | 98 shelf_view_->bounds_animator_->RemoveObserver(observer.get()); |
98 } | 99 } |
99 | 100 |
100 OverflowBubble* ShelfViewTestAPI::overflow_bubble() { | 101 OverflowBubble* ShelfViewTestAPI::overflow_bubble() { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 return shelf_view_->dragged_off_from_overflow_to_shelf_; | 144 return shelf_view_->dragged_off_from_overflow_to_shelf_; |
144 } | 145 } |
145 | 146 |
146 ShelfButtonPressedMetricTracker* | 147 ShelfButtonPressedMetricTracker* |
147 ShelfViewTestAPI::shelf_button_pressed_metric_tracker() { | 148 ShelfViewTestAPI::shelf_button_pressed_metric_tracker() { |
148 return &(shelf_view_->shelf_button_pressed_metric_tracker_); | 149 return &(shelf_view_->shelf_button_pressed_metric_tracker_); |
149 } | 150 } |
150 | 151 |
151 } // namespace test | 152 } // namespace test |
152 } // namespace ash | 153 } // namespace ash |
OLD | NEW |