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" |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 windows.push_back(windows_.window2); | 427 windows.push_back(windows_.window2); |
428 DCHECK(windows_.other_windows.empty()); | 428 DCHECK(windows_.other_windows.empty()); |
429 FindWindowsTouching(windows_.window2, windows_.direction, | 429 FindWindowsTouching(windows_.window2, windows_.direction, |
430 &windows_.other_windows); | 430 &windows_.other_windows); |
431 for (size_t i = 0; i < windows_.other_windows.size(); ++i) { | 431 for (size_t i = 0; i < windows_.other_windows.size(); ++i) { |
432 windows_.other_windows[i]->AddObserver(this); | 432 windows_.other_windows[i]->AddObserver(this); |
433 windows.push_back(windows_.other_windows[i]); | 433 windows.push_back(windows_.other_windows[i]); |
434 } | 434 } |
435 int component = windows_.direction == LEFT_RIGHT ? HTRIGHT : HTBOTTOM; | 435 int component = windows_.direction == LEFT_RIGHT ? HTRIGHT : HTBOTTOM; |
436 window_resizer_.reset(WorkspaceWindowResizer::Create( | 436 window_resizer_.reset(WorkspaceWindowResizer::Create( |
437 windows_.window1, location_in_parent, component, windows)); | 437 windows_.window1, |
| 438 location_in_parent, |
| 439 component, |
| 440 aura::client::WINDOW_MOVE_SOURCE_MOUSE, |
| 441 windows)); |
438 } | 442 } |
439 | 443 |
440 void MultiWindowResizeController::Resize(const gfx::Point& location_in_screen, | 444 void MultiWindowResizeController::Resize(const gfx::Point& location_in_screen, |
441 int event_flags) { | 445 int event_flags) { |
442 gfx::Point location_in_parent(location_in_screen); | 446 gfx::Point location_in_parent(location_in_screen); |
443 aura::client::GetScreenPositionClient(windows_.window1->GetRootWindow())-> | 447 aura::client::GetScreenPositionClient(windows_.window1->GetRootWindow())-> |
444 ConvertPointFromScreen(windows_.window1->parent(), &location_in_parent); | 448 ConvertPointFromScreen(windows_.window1->parent(), &location_in_parent); |
445 window_resizer_->Drag(location_in_parent, event_flags); | 449 window_resizer_->Drag(location_in_parent, event_flags); |
446 gfx::Rect bounds = ScreenAsh::ConvertRectToScreen( | 450 gfx::Rect bounds = ScreenAsh::ConvertRectToScreen( |
447 windows_.window1->parent(), | 451 windows_.window1->parent(), |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 | 536 |
533 gfx::Point window_loc(location_in_screen); | 537 gfx::Point window_loc(location_in_screen); |
534 aura::Window::ConvertPointToTarget( | 538 aura::Window::ConvertPointToTarget( |
535 window->GetRootWindow(), window, &window_loc); | 539 window->GetRootWindow(), window, &window_loc); |
536 return window->HitTest(window_loc) && | 540 return window->HitTest(window_loc) && |
537 window->delegate()->GetNonClientComponent(window_loc) == component; | 541 window->delegate()->GetNonClientComponent(window_loc) == component; |
538 } | 542 } |
539 | 543 |
540 } // namespace internal | 544 } // namespace internal |
541 } // namespace ash | 545 } // namespace ash |
OLD | NEW |