| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/window_positioner.h" | 5 #include "ash/wm/window_positioner.h" |
| 6 | 6 |
| 7 #include "ash/wm/common/window_positioning_utils.h" | 7 #include "ash/wm/common/window_positioning_utils.h" |
| 8 #include "ash/wm/common/window_state.h" |
| 8 #include "ash/wm/common/wm_globals.h" | 9 #include "ash/wm/common/wm_globals.h" |
| 9 #include "ash/wm/common/wm_screen_util.h" | 10 #include "ash/wm/common/wm_screen_util.h" |
| 10 #include "ash/wm/common/wm_window.h" | 11 #include "ash/wm/common/wm_window.h" |
| 11 #include "ash/wm/window_state.h" | |
| 12 #include "ui/compositor/layer.h" | 12 #include "ui/compositor/layer.h" |
| 13 #include "ui/gfx/geometry/insets.h" | 13 #include "ui/gfx/geometry/insets.h" |
| 14 #include "ui/gfx/screen.h" | 14 #include "ui/gfx/screen.h" |
| 15 | 15 |
| 16 namespace ash { | 16 namespace ash { |
| 17 | 17 |
| 18 const int WindowPositioner::kMinimumWindowOffset = 32; | 18 const int WindowPositioner::kMinimumWindowOffset = 32; |
| 19 | 19 |
| 20 // The number of pixels which are kept free top, left and right when a window | 20 // The number of pixels which are kept free top, left and right when a window |
| 21 // gets positioned to its default location. | 21 // gets positioned to its default location. |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 // If the alignment was pushing the window out of the screen, we ignore the | 559 // If the alignment was pushing the window out of the screen, we ignore the |
| 560 // alignment for that call. | 560 // alignment for that call. |
| 561 if (abs(pos.right() - work_area.right()) < grid) | 561 if (abs(pos.right() - work_area.right()) < grid) |
| 562 x = work_area.right() - w; | 562 x = work_area.right() - w; |
| 563 if (abs(pos.bottom() - work_area.bottom()) < grid) | 563 if (abs(pos.bottom() - work_area.bottom()) < grid) |
| 564 y = work_area.bottom() - h; | 564 y = work_area.bottom() - h; |
| 565 return gfx::Rect(x, y, w, h); | 565 return gfx::Rect(x, y, w, h); |
| 566 } | 566 } |
| 567 | 567 |
| 568 } // namespace ash | 568 } // namespace ash |
| OLD | NEW |