OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/lock_layout_manager.h" | 5 #include "ash/wm/lock_layout_manager.h" |
6 | 6 |
7 #include "ash/common/wm/window_state.h" | 7 #include "ash/common/wm/window_state.h" |
8 #include "ash/common/wm/wm_event.h" | 8 #include "ash/common/wm/wm_event.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // LockWindowState replaces default WindowState of a child. | 59 // LockWindowState replaces default WindowState of a child. |
60 wm::WindowState* window_state = LockWindowState::SetLockWindowState(child); | 60 wm::WindowState* window_state = LockWindowState::SetLockWindowState(child); |
61 wm::WMEvent event(wm::WM_EVENT_ADDED_TO_WORKSPACE); | 61 wm::WMEvent event(wm::WM_EVENT_ADDED_TO_WORKSPACE); |
62 window_state->OnWMEvent(&event); | 62 window_state->OnWMEvent(&event); |
63 } | 63 } |
64 | 64 |
65 void LockLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) { | 65 void LockLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) { |
66 child->RemoveObserver(this); | 66 child->RemoveObserver(this); |
67 } | 67 } |
68 | 68 |
69 void LockLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) { | 69 void LockLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) {} |
70 } | |
71 | 70 |
72 void LockLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child, | 71 void LockLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child, |
73 bool visible) { | 72 bool visible) {} |
74 } | |
75 | 73 |
76 void LockLayoutManager::SetChildBounds(aura::Window* child, | 74 void LockLayoutManager::SetChildBounds(aura::Window* child, |
77 const gfx::Rect& requested_bounds) { | 75 const gfx::Rect& requested_bounds) { |
78 wm::WindowState* window_state = wm::GetWindowState(child); | 76 wm::WindowState* window_state = wm::GetWindowState(child); |
79 wm::SetBoundsEvent event(wm::WM_EVENT_SET_BOUNDS, requested_bounds); | 77 wm::SetBoundsEvent event(wm::WM_EVENT_SET_BOUNDS, requested_bounds); |
80 window_state->OnWMEvent(&event); | 78 window_state->OnWMEvent(&event); |
81 } | 79 } |
82 | 80 |
83 void LockLayoutManager::OnWindowHierarchyChanged( | 81 void LockLayoutManager::OnWindowHierarchyChanged( |
84 const WindowObserver::HierarchyChangeParams& params) { | 82 const WindowObserver::HierarchyChangeParams& params) {} |
85 } | |
86 | 83 |
87 void LockLayoutManager::OnWindowPropertyChanged(aura::Window* window, | 84 void LockLayoutManager::OnWindowPropertyChanged(aura::Window* window, |
88 const void* key, | 85 const void* key, |
89 intptr_t old) { | 86 intptr_t old) {} |
90 } | |
91 | 87 |
92 void LockLayoutManager::OnWindowStackingChanged(aura::Window* window) { | 88 void LockLayoutManager::OnWindowStackingChanged(aura::Window* window) {} |
93 } | |
94 | 89 |
95 void LockLayoutManager::OnWindowDestroying(aura::Window* window) { | 90 void LockLayoutManager::OnWindowDestroying(aura::Window* window) { |
96 window->RemoveObserver(this); | 91 window->RemoveObserver(this); |
97 if (root_window_ == window) | 92 if (root_window_ == window) |
98 root_window_ = NULL; | 93 root_window_ = NULL; |
99 } | 94 } |
100 | 95 |
101 void LockLayoutManager::OnWindowBoundsChanged(aura::Window* window, | 96 void LockLayoutManager::OnWindowBoundsChanged(aura::Window* window, |
102 const gfx::Rect& old_bounds, | 97 const gfx::Rect& old_bounds, |
103 const gfx::Rect& new_bounds) { | 98 const gfx::Rect& new_bounds) { |
(...skipping 21 matching lines...) Expand all Loading... |
125 keyboard_bounds_ = new_bounds; | 120 keyboard_bounds_ = new_bounds; |
126 OnWindowResized(); | 121 OnWindowResized(); |
127 } | 122 } |
128 | 123 |
129 void LockLayoutManager::AdjustWindowsForWorkAreaChange( | 124 void LockLayoutManager::AdjustWindowsForWorkAreaChange( |
130 const wm::WMEvent* event) { | 125 const wm::WMEvent* event) { |
131 DCHECK(event->type() == wm::WM_EVENT_DISPLAY_BOUNDS_CHANGED || | 126 DCHECK(event->type() == wm::WM_EVENT_DISPLAY_BOUNDS_CHANGED || |
132 event->type() == wm::WM_EVENT_WORKAREA_BOUNDS_CHANGED); | 127 event->type() == wm::WM_EVENT_WORKAREA_BOUNDS_CHANGED); |
133 | 128 |
134 for (aura::Window::Windows::const_iterator it = window_->children().begin(); | 129 for (aura::Window::Windows::const_iterator it = window_->children().begin(); |
135 it != window_->children().end(); | 130 it != window_->children().end(); ++it) { |
136 ++it) { | |
137 wm::GetWindowState(*it)->OnWMEvent(event); | 131 wm::GetWindowState(*it)->OnWMEvent(event); |
138 } | 132 } |
139 } | 133 } |
140 | 134 |
141 } // namespace ash | 135 } // namespace ash |
OLD | NEW |