| 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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/screen_util.h" | 8 #include "ash/screen_util.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| 11 #include "ash/wm/mru_window_tracker.h" | 11 #include "ash/wm/mru_window_tracker.h" |
| 12 #include "ash/wm/window_resizer.h" | 12 #include "ash/wm/window_resizer.h" |
| 13 #include "ash/wm/window_state.h" | 13 #include "ash/wm/window_state.h" |
| 14 #include "ash/wm/window_util.h" | 14 #include "ash/wm/window_util.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
| 17 #include "ui/aura/window_delegate.h" | 17 #include "ui/aura/window_delegate.h" |
| 18 #include "ui/aura/window_event_dispatcher.h" | 18 #include "ui/aura/window_event_dispatcher.h" |
| 19 #include "ui/compositor/layer.h" | 19 #include "ui/compositor/layer.h" |
| 20 #include "ui/compositor/scoped_layer_animation_settings.h" | 20 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 21 #include "ui/gfx/screen.h" | 21 #include "ui/gfx/screen.h" |
| 22 #include "ui/views/corewm/window_animations.h" | 22 #include "ui/wm/core/window_animations.h" |
| 23 | 23 |
| 24 namespace ash { | 24 namespace ash { |
| 25 | 25 |
| 26 const int WindowPositioner::kMinimumWindowOffset = 32; | 26 const int WindowPositioner::kMinimumWindowOffset = 32; |
| 27 | 27 |
| 28 // The number of pixels which are kept free top, left and right when a window | 28 // The number of pixels which are kept free top, left and right when a window |
| 29 // gets positioned to its default location. | 29 // gets positioned to its default location. |
| 30 // static | 30 // static |
| 31 const int WindowPositioner::kDesktopBorderSize = 16; | 31 const int WindowPositioner::kDesktopBorderSize = 16; |
| 32 | 32 |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 // If the alignment was pushing the window out of the screen, we ignore the | 529 // If the alignment was pushing the window out of the screen, we ignore the |
| 530 // alignment for that call. | 530 // alignment for that call. |
| 531 if (abs(pos.right() - work_area.right()) < grid) | 531 if (abs(pos.right() - work_area.right()) < grid) |
| 532 x = work_area.right() - w; | 532 x = work_area.right() - w; |
| 533 if (abs(pos.bottom() - work_area.bottom()) < grid) | 533 if (abs(pos.bottom() - work_area.bottom()) < grid) |
| 534 y = work_area.bottom() - h; | 534 y = work_area.bottom() - h; |
| 535 return gfx::Rect(x, y, w, h); | 535 return gfx::Rect(x, y, w, h); |
| 536 } | 536 } |
| 537 | 537 |
| 538 } // namespace ash | 538 } // namespace ash |
| OLD | NEW |