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/wm/workspace/workspace_window_resizer.h" | 5 #include "ash/wm/workspace/workspace_window_resizer.h" |
6 | 6 |
7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
9 #include "ash/display/display_controller.h" | 9 #include "ash/display/display_controller.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "base/strings/stringprintf.h" | 24 #include "base/strings/stringprintf.h" |
25 #include "ui/aura/client/aura_constants.h" | 25 #include "ui/aura/client/aura_constants.h" |
26 #include "ui/aura/root_window.h" | 26 #include "ui/aura/root_window.h" |
27 #include "ui/aura/test/event_generator.h" | 27 #include "ui/aura/test/event_generator.h" |
28 #include "ui/aura/test/test_window_delegate.h" | 28 #include "ui/aura/test/test_window_delegate.h" |
29 #include "ui/base/hit_test.h" | 29 #include "ui/base/hit_test.h" |
30 #include "ui/gfx/insets.h" | 30 #include "ui/gfx/insets.h" |
31 #include "ui/gfx/screen.h" | 31 #include "ui/gfx/screen.h" |
32 #include "ui/views/widget/widget.h" | 32 #include "ui/views/widget/widget.h" |
33 | 33 |
34 namespace ui { | 34 namespace gfx { |
35 | 35 |
36 // Class to provide access to SlideAnimation internals for testing. | 36 // Class to provide access to SlideAnimation internals for testing. |
| 37 // TODO: this should be next to SlideAnimation, not here. |
37 class SlideAnimation::TestApi { | 38 class SlideAnimation::TestApi { |
38 public: | 39 public: |
39 explicit TestApi(SlideAnimation* animation) : animation_(animation) {} | 40 explicit TestApi(SlideAnimation* animation) : animation_(animation) {} |
40 | 41 |
41 void SetStartTime(base::TimeTicks ticks) { | 42 void SetStartTime(base::TimeTicks ticks) { |
42 animation_->SetStartTime(ticks); | 43 animation_->SetStartTime(ticks); |
43 } | 44 } |
44 | 45 |
45 void Step(base::TimeTicks ticks) { | 46 void Step(base::TimeTicks ticks) { |
46 animation_->Step(ticks); | 47 animation_->Step(ticks); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 -ash::kResizeOutsideBoundsSize, | 196 -ash::kResizeOutsideBoundsSize, |
196 -ash::kResizeOutsideBoundsSize); | 197 -ash::kResizeOutsideBoundsSize); |
197 gfx::Insets touch_insets = mouse_insets.Scale( | 198 gfx::Insets touch_insets = mouse_insets.Scale( |
198 ash::kResizeOutsideBoundsScaleForTouch); | 199 ash::kResizeOutsideBoundsScaleForTouch); |
199 touch_resize_window_->SetHitTestBoundsOverrideOuter(mouse_insets, | 200 touch_resize_window_->SetHitTestBoundsOverrideOuter(mouse_insets, |
200 touch_insets); | 201 touch_insets); |
201 touch_resize_window_->set_hit_test_bounds_override_inner(mouse_insets); | 202 touch_resize_window_->set_hit_test_bounds_override_inner(mouse_insets); |
202 } | 203 } |
203 | 204 |
204 // Simulate running the animation. | 205 // Simulate running the animation. |
205 void RunAnimationTillComplete(ui::SlideAnimation* animation) { | 206 void RunAnimationTillComplete(gfx::SlideAnimation* animation) { |
206 ui::SlideAnimation::TestApi test_api(animation); | 207 gfx::SlideAnimation::TestApi test_api(animation); |
207 test_api.RunTillComplete(); | 208 test_api.RunTillComplete(); |
208 } | 209 } |
209 | 210 |
210 TestWindowDelegate delegate_; | 211 TestWindowDelegate delegate_; |
211 TestWindowDelegate delegate2_; | 212 TestWindowDelegate delegate2_; |
212 TestWindowDelegate delegate3_; | 213 TestWindowDelegate delegate3_; |
213 TestWindowDelegate delegate4_; | 214 TestWindowDelegate delegate4_; |
214 scoped_ptr<aura::Window> window_; | 215 scoped_ptr<aura::Window> window_; |
215 scoped_ptr<aura::Window> window2_; | 216 scoped_ptr<aura::Window> window2_; |
216 scoped_ptr<aura::Window> window3_; | 217 scoped_ptr<aura::Window> window3_; |
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1935 RunAnimationTillComplete(phantom_controller->animation_.get()); | 1936 RunAnimationTillComplete(phantom_controller->animation_.get()); |
1936 | 1937 |
1937 // Hide phantom controller. Both widgets should close. | 1938 // Hide phantom controller. Both widgets should close. |
1938 phantom_controller->Hide(); | 1939 phantom_controller->Hide(); |
1939 EXPECT_FALSE(phantom_controller->phantom_widget_); | 1940 EXPECT_FALSE(phantom_controller->phantom_widget_); |
1940 EXPECT_FALSE(phantom_controller->phantom_widget_start_); | 1941 EXPECT_FALSE(phantom_controller->phantom_widget_start_); |
1941 } | 1942 } |
1942 | 1943 |
1943 } // namespace internal | 1944 } // namespace internal |
1944 } // namespace ash | 1945 } // namespace ash |
OLD | NEW |