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/common/wm/workspace/multi_window_resize_controller.h" | 5 #include "ash/common/wm/workspace/multi_window_resize_controller.h" |
6 | 6 |
7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
| 8 #include "ash/aura/wm_window_aura.h" |
8 #include "ash/frame/custom_frame_view_ash.h" | 9 #include "ash/frame/custom_frame_view_ash.h" |
9 #include "ash/shell.h" | 10 #include "ash/shell.h" |
10 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
11 #include "ash/test/shell_test_api.h" | 12 #include "ash/test/shell_test_api.h" |
12 #include "ash/wm/aura/wm_window_aura.h" | |
13 #include "ash/wm/window_util.h" | 13 #include "ash/wm/window_util.h" |
14 #include "ash/wm/workspace/workspace_event_handler_test_helper.h" | 14 #include "ash/wm/workspace/workspace_event_handler_test_helper.h" |
15 #include "ash/wm/workspace_controller.h" | 15 #include "ash/wm/workspace_controller.h" |
16 #include "ash/wm/workspace_controller_test_helper.h" | 16 #include "ash/wm/workspace_controller_test_helper.h" |
17 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
18 #include "ui/aura/test/test_window_delegate.h" | 18 #include "ui/aura/test/test_window_delegate.h" |
19 #include "ui/aura/window.h" | 19 #include "ui/aura/window.h" |
20 #include "ui/base/hit_test.h" | 20 #include "ui/base/hit_test.h" |
21 #include "ui/events/test/event_generator.h" | 21 #include "ui/events/test/event_generator.h" |
22 #include "ui/views/widget/widget.h" | 22 #include "ui/views/widget/widget.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 return resize_controller_->show_timer_.IsRunning(); | 88 return resize_controller_->show_timer_.IsRunning(); |
89 } | 89 } |
90 | 90 |
91 void Hide() { | 91 void Hide() { |
92 resize_controller_->Hide(); | 92 resize_controller_->Hide(); |
93 } | 93 } |
94 | 94 |
95 bool HasTarget(aura::Window* window) { | 95 bool HasTarget(aura::Window* window) { |
96 if (!resize_controller_->windows_.is_valid()) | 96 if (!resize_controller_->windows_.is_valid()) |
97 return false; | 97 return false; |
98 wm::WmWindow* wm_window = wm::WmWindowAura::Get(window); | 98 WmWindow* wm_window = WmWindowAura::Get(window); |
99 if ((resize_controller_->windows_.window1 == wm_window || | 99 if ((resize_controller_->windows_.window1 == wm_window || |
100 resize_controller_->windows_.window2 == wm_window)) | 100 resize_controller_->windows_.window2 == wm_window)) |
101 return true; | 101 return true; |
102 return ContainsValue(resize_controller_->windows_.other_windows, wm_window); | 102 return ContainsValue(resize_controller_->windows_.other_windows, wm_window); |
103 } | 103 } |
104 | 104 |
105 bool IsOverWindows(const gfx::Point& loc) { | 105 bool IsOverWindows(const gfx::Point& loc) { |
106 return resize_controller_->IsOverWindows(loc); | 106 return resize_controller_->IsOverWindows(loc); |
107 } | 107 } |
108 | 108 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 | 364 |
365 // Clicking outside the resize handle should immediately hide the resize | 365 // Clicking outside the resize handle should immediately hide the resize |
366 // handle. | 366 // handle. |
367 EXPECT_FALSE(resize_widget_bounds_in_screen.Contains(w1_center_in_screen)); | 367 EXPECT_FALSE(resize_widget_bounds_in_screen.Contains(w1_center_in_screen)); |
368 generator.MoveMouseTo(w1_center_in_screen); | 368 generator.MoveMouseTo(w1_center_in_screen); |
369 generator.ClickLeftButton(); | 369 generator.ClickLeftButton(); |
370 EXPECT_FALSE(IsShowing()); | 370 EXPECT_FALSE(IsShowing()); |
371 } | 371 } |
372 | 372 |
373 } // namespace ash | 373 } // namespace ash |
OLD | NEW |