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/multi_window_resize_controller.h" | 5 #include "ash/wm/workspace/multi_window_resize_controller.h" |
6 | 6 |
7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/wm/window_animations.h" | 10 #include "ash/wm/window_animations.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 DelayedHide(); | 173 DelayedHide(); |
174 } | 174 } |
175 | 175 |
176 if (!windows.is_valid()) | 176 if (!windows.is_valid()) |
177 return; | 177 return; |
178 Hide(); | 178 Hide(); |
179 windows_ = windows; | 179 windows_ = windows; |
180 windows_.window1->AddObserver(this); | 180 windows_.window1->AddObserver(this); |
181 windows_.window2->AddObserver(this); | 181 windows_.window2->AddObserver(this); |
182 show_location_in_parent_ = point_in_window; | 182 show_location_in_parent_ = point_in_window; |
183 Window::ConvertPointToWindow( | 183 Window::ConvertPointToTarget( |
184 window, window->parent(), &show_location_in_parent_); | 184 window, window->parent(), &show_location_in_parent_); |
185 if (show_timer_.IsRunning()) | 185 if (show_timer_.IsRunning()) |
186 return; | 186 return; |
187 show_timer_.Start(FROM_HERE, | 187 show_timer_.Start(FROM_HERE, |
188 base::TimeDelta::FromMilliseconds(kShowDelayMS), | 188 base::TimeDelta::FromMilliseconds(kShowDelayMS), |
189 this, &MultiWindowResizeController::ShowNow); | 189 this, &MultiWindowResizeController::ShowNow); |
190 } | 190 } |
191 | 191 |
192 void MultiWindowResizeController::Hide() { | 192 void MultiWindowResizeController::Hide() { |
193 hide_timer_.Stop(); | 193 hide_timer_.Stop(); |
(...skipping 24 matching lines...) Expand all Loading... |
218 Hide(); | 218 Hide(); |
219 } | 219 } |
220 | 220 |
221 MultiWindowResizeController::ResizeWindows | 221 MultiWindowResizeController::ResizeWindows |
222 MultiWindowResizeController::DetermineWindows( | 222 MultiWindowResizeController::DetermineWindows( |
223 Window* window, | 223 Window* window, |
224 int window_component, | 224 int window_component, |
225 const gfx::Point& point) const { | 225 const gfx::Point& point) const { |
226 ResizeWindows result; | 226 ResizeWindows result; |
227 gfx::Point point_in_parent(point); | 227 gfx::Point point_in_parent(point); |
228 Window::ConvertPointToWindow(window, window->parent(), &point_in_parent); | 228 Window::ConvertPointToTarget(window, window->parent(), &point_in_parent); |
229 switch (window_component) { | 229 switch (window_component) { |
230 case HTRIGHT: | 230 case HTRIGHT: |
231 result.direction = LEFT_RIGHT; | 231 result.direction = LEFT_RIGHT; |
232 result.window1 = window; | 232 result.window1 = window; |
233 result.window2 = FindWindowByEdge( | 233 result.window2 = FindWindowByEdge( |
234 window, HTLEFT, window->bounds().right(), point_in_parent.y()); | 234 window, HTLEFT, window->bounds().right(), point_in_parent.y()); |
235 break; | 235 break; |
236 case HTLEFT: | 236 case HTLEFT: |
237 result.direction = LEFT_RIGHT; | 237 result.direction = LEFT_RIGHT; |
238 result.window1 = FindWindowByEdge( | 238 result.window1 = FindWindowByEdge( |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 } | 498 } |
499 | 499 |
500 bool MultiWindowResizeController::IsOverWindow( | 500 bool MultiWindowResizeController::IsOverWindow( |
501 aura::Window* window, | 501 aura::Window* window, |
502 const gfx::Point& location_in_screen, | 502 const gfx::Point& location_in_screen, |
503 int component) const { | 503 int component) const { |
504 if (!window->delegate()) | 504 if (!window->delegate()) |
505 return false; | 505 return false; |
506 | 506 |
507 gfx::Point window_loc(location_in_screen); | 507 gfx::Point window_loc(location_in_screen); |
508 aura::Window::ConvertPointToWindow( | 508 aura::Window::ConvertPointToTarget( |
509 window->GetRootWindow(), window, &window_loc); | 509 window->GetRootWindow(), window, &window_loc); |
510 return window->HitTest(window_loc) && | 510 return window->HitTest(window_loc) && |
511 window->delegate()->GetNonClientComponent(window_loc) == component; | 511 window->delegate()->GetNonClientComponent(window_loc) == component; |
512 } | 512 } |
513 | 513 |
514 } // namespace internal | 514 } // namespace internal |
515 } // namespace ash | 515 } // namespace ash |
OLD | NEW |