| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 work_area.x() + width, grid_size_); | 122 work_area.x() + width, grid_size_); |
| 123 return gfx::Rect(x, y, mid_x - x, max_y - y); | 123 return gfx::Rect(x, y, mid_x - x, max_y - y); |
| 124 } | 124 } |
| 125 int max_x = | 125 int max_x = |
| 126 WindowResizer::AlignToGridRoundDown(work_area.right(), grid_size_); | 126 WindowResizer::AlignToGridRoundDown(work_area.right(), grid_size_); |
| 127 int x = WindowResizer::AlignToGridRoundUp(max_x - width, grid_size_); | 127 int x = WindowResizer::AlignToGridRoundUp(max_x - width, grid_size_); |
| 128 return gfx::Rect(x , y, max_x - x, max_y - y); | 128 return gfx::Rect(x , y, max_x - x, max_y - y); |
| 129 } | 129 } |
| 130 | 130 |
| 131 bool SnapSizer::AlongEdge(int x) const { | 131 bool SnapSizer::AlongEdge(int x) const { |
| 132 // TODO: need to support multi-monitor. | 132 // TODO: need to support multi-display. |
| 133 gfx::Rect area(gfx::Screen::GetDisplayNearestWindow(window_).bounds()); | 133 gfx::Rect area(gfx::Screen::GetDisplayNearestWindow(window_).bounds()); |
| 134 return (x <= area.x()) || (x >= area.right() - 1); | 134 return (x <= area.x()) || (x >= area.right() - 1); |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace internal | 137 } // namespace internal |
| 138 } // namespace ash | 138 } // namespace ash |
| OLD | NEW |