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 "athena/wm/public/window_manager.h" | 5 #include "athena/wm/public/window_manager.h" |
6 | 6 |
7 #include "athena/common/container_priorities.h" | 7 #include "athena/common/container_priorities.h" |
8 #include "athena/input/public/accelerator_manager.h" | 8 #include "athena/input/public/accelerator_manager.h" |
9 #include "athena/screen/public/screen_manager.h" | 9 #include "athena/screen/public/screen_manager.h" |
10 #include "athena/wm/bezel_controller.h" | 10 #include "athena/wm/bezel_controller.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 void WindowManagerImpl::Layout() { | 116 void WindowManagerImpl::Layout() { |
117 if (!container_) | 117 if (!container_) |
118 return; | 118 return; |
119 SetInOverview(false); | 119 SetInOverview(false); |
120 gfx::Rect bounds = gfx::Rect(container_->bounds().size()); | 120 gfx::Rect bounds = gfx::Rect(container_->bounds().size()); |
121 const aura::Window::Windows& children = container_->children(); | 121 const aura::Window::Windows& children = container_->children(); |
122 for (aura::Window::Windows::const_iterator iter = children.begin(); | 122 for (aura::Window::Windows::const_iterator iter = children.begin(); |
123 iter != children.end(); | 123 iter != children.end(); |
124 ++iter) { | 124 ++iter) { |
125 if ((*iter)->type() == ui::wm::WINDOW_TYPE_NORMAL || | 125 if ((*iter)->type() == ui::wm::WINDOW_TYPE_NORMAL) |
126 (*iter)->type() == ui::wm::WINDOW_TYPE_POPUP) | |
127 (*iter)->SetBounds(bounds); | 126 (*iter)->SetBounds(bounds); |
128 } | 127 } |
129 } | 128 } |
130 | 129 |
131 void WindowManagerImpl::ToggleOverview() { | 130 void WindowManagerImpl::ToggleOverview() { |
132 SetInOverview(overview_.get() == NULL); | 131 SetInOverview(overview_.get() == NULL); |
133 } | 132 } |
134 | 133 |
135 void WindowManagerImpl::SetInOverview(bool active) { | 134 void WindowManagerImpl::SetInOverview(bool active) { |
136 bool in_overview = !!overview_; | 135 bool in_overview = !!overview_; |
137 if (active == in_overview) | 136 if (active == in_overview) |
138 return; | 137 return; |
139 | 138 |
140 if (active) { | 139 if (active) { |
141 overview_ = WindowOverviewMode::Create(container_.get(), this); | 140 overview_ = WindowOverviewMode::Create(container_.get(), |
| 141 container_->children(), this); |
142 FOR_EACH_OBSERVER(WindowManagerObserver, observers_, | 142 FOR_EACH_OBSERVER(WindowManagerObserver, observers_, |
143 OnOverviewModeEnter()); | 143 OnOverviewModeEnter()); |
144 } else { | 144 } else { |
145 overview_.reset(); | 145 overview_.reset(); |
146 FOR_EACH_OBSERVER(WindowManagerObserver, observers_, | 146 FOR_EACH_OBSERVER(WindowManagerObserver, observers_, |
147 OnOverviewModeExit()); | 147 OnOverviewModeExit()); |
148 } | 148 } |
149 } | 149 } |
150 | 150 |
151 void WindowManagerImpl::InstallAccelerators() { | 151 void WindowManagerImpl::InstallAccelerators() { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 DCHECK(!instance); | 244 DCHECK(!instance); |
245 } | 245 } |
246 | 246 |
247 // static | 247 // static |
248 WindowManager* WindowManager::GetInstance() { | 248 WindowManager* WindowManager::GetInstance() { |
249 DCHECK(instance); | 249 DCHECK(instance); |
250 return instance; | 250 return instance; |
251 } | 251 } |
252 | 252 |
253 } // namespace athena | 253 } // namespace athena |
OLD | NEW |