| 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/snap_sizer.h" | 5 #include "ash/wm/workspace/snap_sizer.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "ash/screen_ash.h" | 9 #include "ash/screen_ash.h" |
| 10 #include "ash/wm/window_resizer.h" | 10 #include "ash/wm/window_resizer.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 return gfx::Rect(x, y, mid_x - x, max_y - y); | 107 return gfx::Rect(x, y, mid_x - x, max_y - y); |
| 108 } | 108 } |
| 109 int max_x = | 109 int max_x = |
| 110 WindowResizer::AlignToGridRoundDown(work_area.right(), grid_size_); | 110 WindowResizer::AlignToGridRoundDown(work_area.right(), grid_size_); |
| 111 int x = WindowResizer::AlignToGridRoundUp(max_x - width, grid_size_); | 111 int x = WindowResizer::AlignToGridRoundUp(max_x - width, grid_size_); |
| 112 return gfx::Rect(x , y, max_x - x, max_y - y); | 112 return gfx::Rect(x , y, max_x - x, max_y - y); |
| 113 } | 113 } |
| 114 | 114 |
| 115 bool SnapSizer::AlongEdge(int x) const { | 115 bool SnapSizer::AlongEdge(int x) const { |
| 116 // TODO: need to support multi-monitor. | 116 // TODO: need to support multi-monitor. |
| 117 gfx::Rect area(gfx::Screen::GetMonitorAreaNearestWindow(window_)); | 117 gfx::Rect area(gfx::Screen::GetMonitorNearestWindow(window_).bounds()); |
| 118 return (x <= area.x()) || (x >= area.right() - 1); | 118 return (x <= area.x()) || (x >= area.right() - 1); |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace internal | 121 } // namespace internal |
| 122 } // namespace ash | 122 } // namespace ash |
| OLD | NEW |