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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 internal::ShelfLayoutManager* shelf_layout_manager() { | 184 internal::ShelfLayoutManager* shelf_layout_manager() { |
185 return Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager(); | 185 return Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager(); |
186 } | 186 } |
187 | 187 |
188 void InitTouchResizeWindow(const gfx::Rect& bounds, int window_component) { | 188 void InitTouchResizeWindow(const gfx::Rect& bounds, int window_component) { |
189 touch_resize_delegate_.set_window_component(window_component); | 189 touch_resize_delegate_.set_window_component(window_component); |
190 touch_resize_window_.reset( | 190 touch_resize_window_.reset( |
191 CreateTestWindowInShellWithDelegate(&touch_resize_delegate_, 0, | 191 CreateTestWindowInShellWithDelegate(&touch_resize_delegate_, 0, |
192 bounds)); | 192 bounds)); |
193 gfx::Insets mouse_outer_insets = gfx::Insets(-ash::kResizeOutsideBoundsSize, | 193 gfx::Insets mouse_outer_insets(-ash::kResizeOutsideBoundsSize, |
194 -ash::kResizeOutsideBoundsSize, | 194 -ash::kResizeOutsideBoundsSize, |
195 -ash::kResizeOutsideBoundsSize, | 195 -ash::kResizeOutsideBoundsSize, |
196 -ash::kResizeOutsideBoundsSize); | 196 -ash::kResizeOutsideBoundsSize); |
197 gfx::Insets touch_outer_insets = mouse_outer_insets.Scale( | 197 gfx::Insets touch_outer_insets = mouse_outer_insets.Scale( |
198 ash::kResizeOutsideBoundsScaleForTouch); | 198 ash::kResizeOutsideBoundsScaleForTouch); |
199 touch_resize_window_->SetHitTestBoundsOverrideOuter(mouse_outer_insets, | 199 touch_resize_window_->SetHitTestBoundsOverrideOuter(mouse_outer_insets, |
200 touch_outer_insets); | 200 touch_outer_insets); |
201 touch_resize_window_->set_hit_test_bounds_override_inner( | 201 gfx::Insets inner_insets(ash::kResizeInsideBoundsSize, |
202 gfx::Insets(ash::kResizeInsideBoundsSize, | 202 ash::kResizeInsideBoundsSize, |
203 ash::kResizeInsideBoundsSize, | 203 ash::kResizeInsideBoundsSize, |
204 ash::kResizeInsideBoundsSize, | 204 ash::kResizeInsideBoundsSize); |
205 ash::kResizeInsideBoundsSize)); | 205 touch_resize_window_->SetHitTestBoundsOverrideInner(inner_insets, |
| 206 inner_insets); |
206 } | 207 } |
207 | 208 |
208 // Simulate running the animation. | 209 // Simulate running the animation. |
209 void RunAnimationTillComplete(gfx::SlideAnimation* animation) { | 210 void RunAnimationTillComplete(gfx::SlideAnimation* animation) { |
210 gfx::SlideAnimation::TestApi test_api(animation); | 211 gfx::SlideAnimation::TestApi test_api(animation); |
211 test_api.RunTillComplete(); | 212 test_api.RunTillComplete(); |
212 } | 213 } |
213 | 214 |
214 TestWindowDelegate delegate_; | 215 TestWindowDelegate delegate_; |
215 TestWindowDelegate delegate2_; | 216 TestWindowDelegate delegate2_; |
(...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1959 RunAnimationTillComplete(phantom_controller->animation_.get()); | 1960 RunAnimationTillComplete(phantom_controller->animation_.get()); |
1960 | 1961 |
1961 // Hide phantom controller. Both widgets should close. | 1962 // Hide phantom controller. Both widgets should close. |
1962 phantom_controller->Hide(); | 1963 phantom_controller->Hide(); |
1963 EXPECT_FALSE(phantom_controller->phantom_widget_); | 1964 EXPECT_FALSE(phantom_controller->phantom_widget_); |
1964 EXPECT_FALSE(phantom_controller->phantom_widget_start_); | 1965 EXPECT_FALSE(phantom_controller->phantom_widget_start_); |
1965 } | 1966 } |
1966 | 1967 |
1967 } // namespace internal | 1968 } // namespace internal |
1968 } // namespace ash | 1969 } // namespace ash |
OLD | NEW |