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/window_util.h" | 5 #include "ash/wm/window_util.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 70 } |
71 | 71 |
72 bool CanActivateWindow(aura::Window* window) { | 72 bool CanActivateWindow(aura::Window* window) { |
73 return ::wm::CanActivateWindow(window); | 73 return ::wm::CanActivateWindow(window); |
74 } | 74 } |
75 | 75 |
76 bool IsWindowMinimized(aura::Window* window) { | 76 bool IsWindowMinimized(aura::Window* window) { |
77 return ash::wm::GetWindowState(window)->IsMinimized(); | 77 return ash::wm::GetWindowState(window)->IsMinimized(); |
78 } | 78 } |
79 | 79 |
| 80 bool IsWindowUserPositionable(aura::Window* window) { |
| 81 return GetWindowState(window)->IsUserPositionable(); |
| 82 } |
| 83 |
80 void CenterWindow(aura::Window* window) { | 84 void CenterWindow(aura::Window* window) { |
81 wm::WMEvent event(wm::WM_EVENT_CENTER); | 85 wm::WMEvent event(wm::WM_EVENT_CENTER); |
82 wm::GetWindowState(window)->OnWMEvent(&event); | 86 wm::GetWindowState(window)->OnWMEvent(&event); |
83 } | 87 } |
84 | 88 |
85 gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent(aura::Window* window) { | 89 gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent(aura::Window* window) { |
86 gfx::Rect work_area_in_parent(ScreenUtil::GetDisplayWorkAreaBoundsInParent( | 90 gfx::Rect work_area_in_parent(ScreenUtil::GetDisplayWorkAreaBoundsInParent( |
87 window)); | 91 window)); |
88 return gfx::Rect(work_area_in_parent.x(), | 92 return gfx::Rect(work_area_in_parent.x(), |
89 work_area_in_parent.y(), | 93 work_area_in_parent.y(), |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 if (!container->layout_manager()) | 205 if (!container->layout_manager()) |
202 container->SetLayoutManager(new SnapToPixelLayoutManager(container)); | 206 container->SetLayoutManager(new SnapToPixelLayoutManager(container)); |
203 } else { | 207 } else { |
204 InstallSnapLayoutManagerToContainers(container); | 208 InstallSnapLayoutManagerToContainers(container); |
205 } | 209 } |
206 } | 210 } |
207 } | 211 } |
208 | 212 |
209 } // namespace wm | 213 } // namespace wm |
210 } // namespace ash | 214 } // namespace ash |
OLD | NEW |