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/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 | 91 |
92 void PinWindow(aura::Window* window, bool trusted) { | 92 void PinWindow(aura::Window* window, bool trusted) { |
93 wm::WMEvent event(trusted ? wm::WM_EVENT_TRUSTED_PIN : wm::WM_EVENT_PIN); | 93 wm::WMEvent event(trusted ? wm::WM_EVENT_TRUSTED_PIN : wm::WM_EVENT_PIN); |
94 wm::GetWindowState(window)->OnWMEvent(&event); | 94 wm::GetWindowState(window)->OnWMEvent(&event); |
95 } | 95 } |
96 | 96 |
97 void SetAutoHideShelf(aura::Window* window, bool autohide) { | 97 void SetAutoHideShelf(aura::Window* window, bool autohide) { |
98 wm::GetWindowState(window)->set_autohide_shelf_when_maximized_or_fullscreen( | 98 wm::GetWindowState(window)->set_autohide_shelf_when_maximized_or_fullscreen( |
99 autohide); | 99 autohide); |
100 for (WmWindow* root_window : ShellPort::Get()->GetAllRootWindows()) | 100 for (aura::Window* root_window : Shell::GetAllRootWindows()) |
101 WmShelf::ForWindow(root_window)->UpdateVisibilityState(); | 101 WmShelf::ForWindow(root_window)->UpdateVisibilityState(); |
102 } | 102 } |
103 | 103 |
104 bool MoveWindowToDisplay(aura::Window* window, int64_t display_id) { | 104 bool MoveWindowToDisplay(aura::Window* window, int64_t display_id) { |
105 DCHECK(window); | 105 DCHECK(window); |
106 WmWindow* root = ShellPort::Get()->GetRootWindowForDisplayId(display_id); | 106 aura::Window* root = ShellPort::Get()->GetRootWindowForDisplayId(display_id); |
107 return root && MoveWindowToRoot(window, root->aura_window()); | 107 return root && MoveWindowToRoot(window, root); |
108 } | 108 } |
109 | 109 |
110 bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) { | 110 bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) { |
111 DCHECK(window); | 111 DCHECK(window); |
112 views::View* target = static_cast<views::View*>(event.target()); | 112 views::View* target = static_cast<views::View*>(event.target()); |
113 if (!target) | 113 if (!target) |
114 return false; | 114 return false; |
115 aura::Window* root = target->GetWidget()->GetNativeView()->GetRootWindow(); | 115 aura::Window* root = target->GetWidget()->GetNativeView()->GetRootWindow(); |
116 return root && MoveWindowToRoot(window, root); | 116 return root && MoveWindowToRoot(window, root); |
117 } | 117 } |
(...skipping 12 matching lines...) Expand all Loading... |
130 } | 130 } |
131 | 131 |
132 void SetSnapsChildrenToPhysicalPixelBoundary(aura::Window* container) { | 132 void SetSnapsChildrenToPhysicalPixelBoundary(aura::Window* container) { |
133 DCHECK(!container->GetProperty(kSnapChildrenToPixelBoundary)) | 133 DCHECK(!container->GetProperty(kSnapChildrenToPixelBoundary)) |
134 << container->GetName(); | 134 << container->GetName(); |
135 container->SetProperty(kSnapChildrenToPixelBoundary, true); | 135 container->SetProperty(kSnapChildrenToPixelBoundary, true); |
136 } | 136 } |
137 | 137 |
138 } // namespace wm | 138 } // namespace wm |
139 } // namespace ash | 139 } // namespace ash |
OLD | NEW |