Chromium Code Reviews| 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/coordinate_conversion.h" | 10 #include "ash/wm/coordinate_conversion.h" |
| 11 #include "ash/wm/window_animations.h" | 11 #include "ash/wm/window_animations.h" |
| 12 #include "ash/wm/window_util.h" | |
| 12 #include "ash/wm/workspace/workspace_event_handler.h" | 13 #include "ash/wm/workspace/workspace_event_handler.h" |
| 13 #include "ash/wm/workspace/workspace_window_resizer.h" | 14 #include "ash/wm/workspace/workspace_window_resizer.h" |
| 14 #include "grit/ash_resources.h" | 15 #include "grit/ash_resources.h" |
| 15 #include "ui/aura/client/screen_position_client.h" | 16 #include "ui/aura/client/screen_position_client.h" |
| 16 #include "ui/aura/event_filter.h" | 17 #include "ui/aura/event_filter.h" |
| 17 #include "ui/aura/root_window.h" | 18 #include "ui/aura/root_window.h" |
| 18 #include "ui/aura/shared/compound_event_filter.h" | 19 #include "ui/aura/shared/compound_event_filter.h" |
| 19 #include "ui/aura/window.h" | 20 #include "ui/aura/window.h" |
| 20 #include "ui/aura/window_delegate.h" | 21 #include "ui/aura/window_delegate.h" |
| 21 #include "ui/base/hit_test.h" | 22 #include "ui/base/hit_test.h" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 279 Window* MultiWindowResizeController::FindWindowByEdge( | 280 Window* MultiWindowResizeController::FindWindowByEdge( |
| 280 Window* window_to_ignore, | 281 Window* window_to_ignore, |
| 281 int edge_want, | 282 int edge_want, |
| 282 int x, | 283 int x, |
| 283 int y) const { | 284 int y) const { |
| 284 Window* parent = window_to_ignore->parent(); | 285 Window* parent = window_to_ignore->parent(); |
| 285 const Window::Windows& windows(parent->children()); | 286 const Window::Windows& windows(parent->children()); |
| 286 for (Window::Windows::const_reverse_iterator i = windows.rbegin(); | 287 for (Window::Windows::const_reverse_iterator i = windows.rbegin(); |
| 287 i != windows.rend(); ++i) { | 288 i != windows.rend(); ++i) { |
| 288 Window* window = *i; | 289 Window* window = *i; |
| 289 if (window == window_to_ignore || !window->IsVisible()) | 290 if (window == window_to_ignore || !window->IsVisible() || |
| 291 !wm::CanResizeWindow(window)) | |
|
sky
2012/11/13 17:01:54
The multi-window resizer may just move the other w
Mr4D (OOO till 08-26)
2012/11/13 21:27:23
After investigating I have figured out that the fr
| |
| 290 continue; | 292 continue; |
| 291 switch (edge_want) { | 293 switch (edge_want) { |
| 292 case HTLEFT: | 294 case HTLEFT: |
| 293 if (ContainsY(window, y) && window->bounds().x() == x) | 295 if (ContainsY(window, y) && window->bounds().x() == x) |
| 294 return window; | 296 return window; |
| 295 break; | 297 break; |
| 296 case HTRIGHT: | 298 case HTRIGHT: |
| 297 if (ContainsY(window, y) && window->bounds().right() == x) | 299 if (ContainsY(window, y) && window->bounds().right() == x) |
| 298 return window; | 300 return window; |
| 299 break; | 301 break; |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 319 aura::Window* MultiWindowResizeController::FindWindowTouching( | 321 aura::Window* MultiWindowResizeController::FindWindowTouching( |
| 320 aura::Window* window, | 322 aura::Window* window, |
| 321 Direction direction) const { | 323 Direction direction) const { |
| 322 int right = window->bounds().right(); | 324 int right = window->bounds().right(); |
| 323 int bottom = window->bounds().bottom(); | 325 int bottom = window->bounds().bottom(); |
| 324 Window* parent = window->parent(); | 326 Window* parent = window->parent(); |
| 325 const Window::Windows& windows(parent->children()); | 327 const Window::Windows& windows(parent->children()); |
| 326 for (Window::Windows::const_reverse_iterator i = windows.rbegin(); | 328 for (Window::Windows::const_reverse_iterator i = windows.rbegin(); |
| 327 i != windows.rend(); ++i) { | 329 i != windows.rend(); ++i) { |
| 328 Window* other = *i; | 330 Window* other = *i; |
| 329 if (other == window || !other->IsVisible()) | 331 if (other == window || !other->IsVisible() || !wm::CanResizeWindow(other)) |
| 330 continue; | 332 continue; |
| 331 switch (direction) { | 333 switch (direction) { |
| 332 case TOP_BOTTOM: | 334 case TOP_BOTTOM: |
| 333 if (other->bounds().y() == bottom && | 335 if (other->bounds().y() == bottom && |
| 334 Intersects(other->bounds().x(), other->bounds().right(), | 336 Intersects(other->bounds().x(), other->bounds().right(), |
| 335 window->bounds().x(), window->bounds().right())) { | 337 window->bounds().x(), window->bounds().right())) { |
| 336 return other; | 338 return other; |
| 337 } | 339 } |
| 338 break; | 340 break; |
| 339 case LEFT_RIGHT: | 341 case LEFT_RIGHT: |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 533 | 535 |
| 534 gfx::Point window_loc(location_in_screen); | 536 gfx::Point window_loc(location_in_screen); |
| 535 aura::Window::ConvertPointToTarget( | 537 aura::Window::ConvertPointToTarget( |
| 536 window->GetRootWindow(), window, &window_loc); | 538 window->GetRootWindow(), window, &window_loc); |
| 537 return window->HitTest(window_loc) && | 539 return window->HitTest(window_loc) && |
| 538 window->delegate()->GetNonClientComponent(window_loc) == component; | 540 window->delegate()->GetNonClientComponent(window_loc) == component; |
| 539 } | 541 } |
| 540 | 542 |
| 541 } // namespace internal | 543 } // namespace internal |
| 542 } // namespace ash | 544 } // namespace ash |
| OLD | NEW |