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/aura/wm_window_aura.h" | 9 #include "ash/aura/wm_window_aura.h" |
10 #include "ash/common/ash_constants.h" | 10 #include "ash/common/ash_constants.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 bool CanActivateWindow(aura::Window* window) { | 57 bool CanActivateWindow(aura::Window* window) { |
58 return ::wm::CanActivateWindow(window); | 58 return ::wm::CanActivateWindow(window); |
59 } | 59 } |
60 | 60 |
61 bool IsWindowUserPositionable(aura::Window* window) { | 61 bool IsWindowUserPositionable(aura::Window* window) { |
62 return GetWindowState(window)->IsUserPositionable(); | 62 return GetWindowState(window)->IsUserPositionable(); |
63 } | 63 } |
64 | 64 |
65 void CenterWindow(aura::Window* window) { | |
66 wm::WMEvent event(wm::WM_EVENT_CENTER); | |
67 wm::GetWindowState(window)->OnWMEvent(&event); | |
68 } | |
69 | |
70 void PinWindow(aura::Window* window) { | 65 void PinWindow(aura::Window* window) { |
71 wm::WMEvent event(wm::WM_EVENT_PIN); | 66 wm::WMEvent event(wm::WM_EVENT_PIN); |
72 wm::GetWindowState(window)->OnWMEvent(&event); | 67 wm::GetWindowState(window)->OnWMEvent(&event); |
73 } | 68 } |
74 | 69 |
75 bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) { | 70 bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) { |
76 views::View* target = static_cast<views::View*>(event.target()); | 71 views::View* target = static_cast<views::View*>(event.target()); |
77 if (!target) | 72 if (!target) |
78 return false; | 73 return false; |
79 aura::Window* target_root = | 74 aura::Window* target_root = |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 if (!container->layout_manager()) | 111 if (!container->layout_manager()) |
117 container->SetLayoutManager(new SnapToPixelLayoutManager(container)); | 112 container->SetLayoutManager(new SnapToPixelLayoutManager(container)); |
118 } else { | 113 } else { |
119 InstallSnapLayoutManagerToContainers(container); | 114 InstallSnapLayoutManagerToContainers(container); |
120 } | 115 } |
121 } | 116 } |
122 } | 117 } |
123 | 118 |
124 } // namespace wm | 119 } // namespace wm |
125 } // namespace ash | 120 } // namespace ash |
OLD | NEW |