| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/common/wm/window_positioning_utils.h" | 5 #include "ash/common/wm/window_positioning_utils.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/wm/window_state.h" |
| 10 #include "ash/common/wm/wm_event.h" |
| 9 #include "ash/common/wm/wm_screen_util.h" | 11 #include "ash/common/wm/wm_screen_util.h" |
| 10 #include "ash/common/wm_window.h" | 12 #include "ash/common/wm_window.h" |
| 11 #include "ui/gfx/geometry/rect.h" | 13 #include "ui/gfx/geometry/rect.h" |
| 12 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
| 13 | 15 |
| 14 namespace ash { | 16 namespace ash { |
| 15 namespace wm { | 17 namespace wm { |
| 16 | 18 |
| 17 namespace { | 19 namespace { |
| 18 | 20 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 work_area_in_parent.height()); | 72 work_area_in_parent.height()); |
| 71 } | 73 } |
| 72 | 74 |
| 73 gfx::Rect GetDefaultRightSnappedWindowBoundsInParent(WmWindow* window) { | 75 gfx::Rect GetDefaultRightSnappedWindowBoundsInParent(WmWindow* window) { |
| 74 gfx::Rect work_area_in_parent(GetDisplayWorkAreaBoundsInParent(window)); | 76 gfx::Rect work_area_in_parent(GetDisplayWorkAreaBoundsInParent(window)); |
| 75 int width = GetDefaultSnappedWindowWidth(window); | 77 int width = GetDefaultSnappedWindowWidth(window); |
| 76 return gfx::Rect(work_area_in_parent.right() - width, work_area_in_parent.y(), | 78 return gfx::Rect(work_area_in_parent.right() - width, work_area_in_parent.y(), |
| 77 width, work_area_in_parent.height()); | 79 width, work_area_in_parent.height()); |
| 78 } | 80 } |
| 79 | 81 |
| 82 void CenterWindow(WmWindow* window) { |
| 83 WMEvent event(WM_EVENT_CENTER); |
| 84 window->GetWindowState()->OnWMEvent(&event); |
| 85 } |
| 86 |
| 80 } // namespace wm | 87 } // namespace wm |
| 81 } // namespace ash | 88 } // namespace ash |
| OLD | NEW |