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/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 // |bounds| and |work_area| are in |window()->parent()|'s coordinates. |
| 287 gfx::Screen::GetDisplayNearestWindow(window()).work_area()); | 287 gfx::Rect work_area(ScreenAsh::ConvertRectFromScreen( |
| 288 window()->parent(), | |
| 289 gfx::Screen::GetDisplayNearestWindow(window()).work_area())); | |
|
oshima
2012/08/09 00:59:35
Can you use ScreenAsh::GetDisplayWorkAreaInParent(
mazda
2012/08/09 01:07:19
Done.
| |
| 288 std::vector<int> sizes; | 290 std::vector<int> sizes; |
| 289 CalculateAttachedSizes( | 291 CalculateAttachedSizes( |
| 290 PrimaryAxisSize(details_.initial_bounds.size()), | 292 PrimaryAxisSize(details_.initial_bounds.size()), |
| 291 PrimaryAxisSize(bounds.size()), | 293 PrimaryAxisSize(bounds.size()), |
| 292 PrimaryAxisCoordinate(bounds.right(), bounds.bottom()), | 294 PrimaryAxisCoordinate(bounds.right(), bounds.bottom()), |
| 293 PrimaryAxisCoordinate(work_area.right(), work_area.bottom()), | 295 PrimaryAxisCoordinate(work_area.right(), work_area.bottom()), |
| 294 grid_size, | 296 grid_size, |
| 295 &sizes); | 297 &sizes); |
| 296 DCHECK_EQ(attached_windows_.size(), sizes.size()); | 298 DCHECK_EQ(attached_windows_.size(), sizes.size()); |
| 297 int last = PrimaryAxisCoordinate(bounds.right(), bounds.bottom()); | 299 int last = PrimaryAxisCoordinate(bounds.right(), bounds.bottom()); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 538 } | 540 } |
| 539 | 541 |
| 540 bool WorkspaceWindowResizer::ShouldAllowMouseWarp() const { | 542 bool WorkspaceWindowResizer::ShouldAllowMouseWarp() const { |
| 541 return (details_.window_component == HTCAPTION) && | 543 return (details_.window_component == HTCAPTION) && |
| 542 (window()->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE) && | 544 (window()->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE) && |
| 543 (window()->type() == aura::client::WINDOW_TYPE_NORMAL); | 545 (window()->type() == aura::client::WINDOW_TYPE_NORMAL); |
| 544 } | 546 } |
| 545 | 547 |
| 546 } // namespace internal | 548 } // namespace internal |
| 547 } // namespace ash | 549 } // namespace ash |
| OLD | NEW |