| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "ash/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 if (snap_phantom_window_controller_.get() && | 276 if (snap_phantom_window_controller_.get() && |
| 277 snap_phantom_window_controller_->IsShowing()) { | 277 snap_phantom_window_controller_->IsShowing()) { |
| 278 return snap_phantom_window_controller_->bounds(); | 278 return snap_phantom_window_controller_->bounds(); |
| 279 } | 279 } |
| 280 return AdjustBoundsToGrid(bounds, grid_size); | 280 return AdjustBoundsToGrid(bounds, grid_size); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void WorkspaceWindowResizer::LayoutAttachedWindows( | 283 void WorkspaceWindowResizer::LayoutAttachedWindows( |
| 284 const gfx::Rect& bounds, | 284 const gfx::Rect& bounds, |
| 285 int grid_size) { | 285 int grid_size) { |
| 286 gfx::Rect work_area( | 286 gfx::Rect work_area(ScreenAsh::GetDisplayWorkAreaBoundsInParent(window())); |
| 287 gfx::Screen::GetDisplayNearestWindow(window()).work_area()); | |
| 288 std::vector<int> sizes; | 287 std::vector<int> sizes; |
| 289 CalculateAttachedSizes( | 288 CalculateAttachedSizes( |
| 290 PrimaryAxisSize(details_.initial_bounds.size()), | 289 PrimaryAxisSize(details_.initial_bounds.size()), |
| 291 PrimaryAxisSize(bounds.size()), | 290 PrimaryAxisSize(bounds.size()), |
| 292 PrimaryAxisCoordinate(bounds.right(), bounds.bottom()), | 291 PrimaryAxisCoordinate(bounds.right(), bounds.bottom()), |
| 293 PrimaryAxisCoordinate(work_area.right(), work_area.bottom()), | 292 PrimaryAxisCoordinate(work_area.right(), work_area.bottom()), |
| 294 grid_size, | 293 grid_size, |
| 295 &sizes); | 294 &sizes); |
| 296 DCHECK_EQ(attached_windows_.size(), sizes.size()); | 295 DCHECK_EQ(attached_windows_.size(), sizes.size()); |
| 297 int last = PrimaryAxisCoordinate(bounds.right(), bounds.bottom()); | 296 int last = PrimaryAxisCoordinate(bounds.right(), bounds.bottom()); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 } | 537 } |
| 539 | 538 |
| 540 bool WorkspaceWindowResizer::ShouldAllowMouseWarp() const { | 539 bool WorkspaceWindowResizer::ShouldAllowMouseWarp() const { |
| 541 return (details_.window_component == HTCAPTION) && | 540 return (details_.window_component == HTCAPTION) && |
| 542 (window()->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE) && | 541 (window()->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE) && |
| 543 (window()->type() == aura::client::WINDOW_TYPE_NORMAL); | 542 (window()->type() == aura::client::WINDOW_TYPE_NORMAL); |
| 544 } | 543 } |
| 545 | 544 |
| 546 } // namespace internal | 545 } // namespace internal |
| 547 } // namespace ash | 546 } // namespace ash |
| OLD | NEW |