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. |
sky
2012/08/09 15:57:33
Remove comment since coordinate system is document
mazda
2012/08/09 16:08:50
Done.
| |
287 gfx::Screen::GetDisplayNearestWindow(window()).work_area()); | 287 gfx::Rect work_area(ScreenAsh::GetDisplayWorkAreaBoundsInParent(window())); |
288 std::vector<int> sizes; | 288 std::vector<int> sizes; |
289 CalculateAttachedSizes( | 289 CalculateAttachedSizes( |
290 PrimaryAxisSize(details_.initial_bounds.size()), | 290 PrimaryAxisSize(details_.initial_bounds.size()), |
291 PrimaryAxisSize(bounds.size()), | 291 PrimaryAxisSize(bounds.size()), |
292 PrimaryAxisCoordinate(bounds.right(), bounds.bottom()), | 292 PrimaryAxisCoordinate(bounds.right(), bounds.bottom()), |
293 PrimaryAxisCoordinate(work_area.right(), work_area.bottom()), | 293 PrimaryAxisCoordinate(work_area.right(), work_area.bottom()), |
294 grid_size, | 294 grid_size, |
295 &sizes); | 295 &sizes); |
296 DCHECK_EQ(attached_windows_.size(), sizes.size()); | 296 DCHECK_EQ(attached_windows_.size(), sizes.size()); |
297 int last = PrimaryAxisCoordinate(bounds.right(), bounds.bottom()); | 297 int last = PrimaryAxisCoordinate(bounds.right(), bounds.bottom()); |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
538 } | 538 } |
539 | 539 |
540 bool WorkspaceWindowResizer::ShouldAllowMouseWarp() const { | 540 bool WorkspaceWindowResizer::ShouldAllowMouseWarp() const { |
541 return (details_.window_component == HTCAPTION) && | 541 return (details_.window_component == HTCAPTION) && |
542 (window()->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE) && | 542 (window()->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE) && |
543 (window()->type() == aura::client::WINDOW_TYPE_NORMAL); | 543 (window()->type() == aura::client::WINDOW_TYPE_NORMAL); |
544 } | 544 } |
545 | 545 |
546 } // namespace internal | 546 } // namespace internal |
547 } // namespace ash | 547 } // namespace ash |
OLD | NEW |