| 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" |
| 11 #include "ash/shelf/wm_shelf.h" | 11 #include "ash/shelf/shelf.h" |
| 12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 13 #include "ash/shell_port.h" | 13 #include "ash/shell_port.h" |
| 14 #include "ash/wm/window_properties.h" | 14 #include "ash/wm/window_properties.h" |
| 15 #include "ash/wm/window_state.h" | 15 #include "ash/wm/window_state.h" |
| 16 #include "ash/wm/wm_event.h" | 16 #include "ash/wm/wm_event.h" |
| 17 #include "ash/wm_window.h" | 17 #include "ash/wm_window.h" |
| 18 #include "ui/aura/client/aura_constants.h" | 18 #include "ui/aura/client/aura_constants.h" |
| 19 #include "ui/aura/client/capture_client.h" | 19 #include "ui/aura/client/capture_client.h" |
| 20 #include "ui/aura/client/focus_client.h" | 20 #include "ui/aura/client/focus_client.h" |
| 21 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 void PinWindow(aura::Window* window, bool trusted) { | 91 void PinWindow(aura::Window* window, bool trusted) { |
| 92 wm::WMEvent event(trusted ? wm::WM_EVENT_TRUSTED_PIN : wm::WM_EVENT_PIN); | 92 wm::WMEvent event(trusted ? wm::WM_EVENT_TRUSTED_PIN : wm::WM_EVENT_PIN); |
| 93 wm::GetWindowState(window)->OnWMEvent(&event); | 93 wm::GetWindowState(window)->OnWMEvent(&event); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void SetAutoHideShelf(aura::Window* window, bool autohide) { | 96 void SetAutoHideShelf(aura::Window* window, bool autohide) { |
| 97 wm::GetWindowState(window)->set_autohide_shelf_when_maximized_or_fullscreen( | 97 wm::GetWindowState(window)->set_autohide_shelf_when_maximized_or_fullscreen( |
| 98 autohide); | 98 autohide); |
| 99 for (aura::Window* root_window : Shell::GetAllRootWindows()) | 99 for (aura::Window* root_window : Shell::GetAllRootWindows()) |
| 100 WmShelf::ForWindow(root_window)->UpdateVisibilityState(); | 100 Shelf::ForWindow(root_window)->UpdateVisibilityState(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 bool MoveWindowToDisplay(aura::Window* window, int64_t display_id) { | 103 bool MoveWindowToDisplay(aura::Window* window, int64_t display_id) { |
| 104 DCHECK(window); | 104 DCHECK(window); |
| 105 aura::Window* root = ShellPort::Get()->GetRootWindowForDisplayId(display_id); | 105 aura::Window* root = ShellPort::Get()->GetRootWindowForDisplayId(display_id); |
| 106 return root && MoveWindowToRoot(window, root); | 106 return root && MoveWindowToRoot(window, root); |
| 107 } | 107 } |
| 108 | 108 |
| 109 bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) { | 109 bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) { |
| 110 DCHECK(window); | 110 DCHECK(window); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 129 } | 129 } |
| 130 | 130 |
| 131 void SetSnapsChildrenToPhysicalPixelBoundary(aura::Window* container) { | 131 void SetSnapsChildrenToPhysicalPixelBoundary(aura::Window* container) { |
| 132 DCHECK(!container->GetProperty(kSnapChildrenToPixelBoundary)) | 132 DCHECK(!container->GetProperty(kSnapChildrenToPixelBoundary)) |
| 133 << container->GetName(); | 133 << container->GetName(); |
| 134 container->SetProperty(kSnapChildrenToPixelBoundary, true); | 134 container->SetProperty(kSnapChildrenToPixelBoundary, true); |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace wm | 137 } // namespace wm |
| 138 } // namespace ash | 138 } // namespace ash |
| OLD | NEW |