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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "athena/common/container_priorities.h" | 9 #include "athena/common/container_priorities.h" |
10 #include "athena/input/public/accelerator_manager.h" | 10 #include "athena/input/public/accelerator_manager.h" |
11 #include "athena/screen/public/screen_manager.h" | 11 #include "athena/screen/public/screen_manager.h" |
12 #include "athena/wm/bezel_controller.h" | 12 #include "athena/wm/bezel_controller.h" |
13 #include "athena/wm/mru_window_tracker.h" | 13 #include "athena/wm/mru_window_tracker.h" |
14 #include "athena/wm/public/window_manager_observer.h" | 14 #include "athena/wm/public/window_manager_observer.h" |
15 #include "athena/wm/split_view_controller.h" | 15 #include "athena/wm/split_view_controller.h" |
16 #include "athena/wm/title_drag_controller.h" | 16 #include "athena/wm/title_drag_controller.h" |
17 #include "athena/wm/window_overview_mode.h" | 17 #include "athena/wm/window_overview_mode.h" |
18 #include "base/logging.h" | 18 #include "base/logging.h" |
19 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
20 #include "ui/aura/layout_manager.h" | 20 #include "ui/aura/layout_manager.h" |
21 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
| 22 #include "ui/gfx/display.h" |
| 23 #include "ui/gfx/screen.h" |
22 #include "ui/wm/core/shadow_controller.h" | 24 #include "ui/wm/core/shadow_controller.h" |
23 #include "ui/wm/core/window_util.h" | 25 #include "ui/wm/core/window_util.h" |
24 #include "ui/wm/core/wm_state.h" | 26 #include "ui/wm/core/wm_state.h" |
25 #include "ui/wm/public/activation_client.h" | 27 #include "ui/wm/public/activation_client.h" |
26 #include "ui/wm/public/window_types.h" | 28 #include "ui/wm/public/window_types.h" |
27 | 29 |
28 namespace athena { | 30 namespace athena { |
29 namespace { | 31 namespace { |
30 | 32 |
31 class WindowManagerImpl : public WindowManager, | 33 class WindowManagerImpl : public WindowManager, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 } | 142 } |
141 // |title_drag_controller_| needs to be reset before |container_|. | 143 // |title_drag_controller_| needs to be reset before |container_|. |
142 title_drag_controller_.reset(); | 144 title_drag_controller_.reset(); |
143 container_.reset(); | 145 container_.reset(); |
144 instance = NULL; | 146 instance = NULL; |
145 } | 147 } |
146 | 148 |
147 void WindowManagerImpl::Layout() { | 149 void WindowManagerImpl::Layout() { |
148 if (!container_) | 150 if (!container_) |
149 return; | 151 return; |
150 gfx::Rect bounds = gfx::Rect(container_->bounds().size()); | 152 gfx::Rect bounds = |
| 153 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area(); |
151 const aura::Window::Windows& children = container_->children(); | 154 const aura::Window::Windows& children = container_->children(); |
152 for (aura::Window::Windows::const_iterator iter = children.begin(); | 155 for (aura::Window::Windows::const_iterator iter = children.begin(); |
153 iter != children.end(); | 156 iter != children.end(); |
154 ++iter) { | 157 ++iter) { |
155 if ((*iter)->type() == ui::wm::WINDOW_TYPE_NORMAL) | 158 if ((*iter)->type() == ui::wm::WINDOW_TYPE_NORMAL) |
156 (*iter)->SetBounds(bounds); | 159 (*iter)->SetBounds(bounds); |
157 } | 160 } |
158 } | 161 } |
159 | 162 |
160 void WindowManagerImpl::ToggleOverview() { | 163 void WindowManagerImpl::ToggleOverview() { |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 DCHECK(!instance); | 311 DCHECK(!instance); |
309 } | 312 } |
310 | 313 |
311 // static | 314 // static |
312 WindowManager* WindowManager::GetInstance() { | 315 WindowManager* WindowManager::GetInstance() { |
313 DCHECK(instance); | 316 DCHECK(instance); |
314 return instance; | 317 return instance; |
315 } | 318 } |
316 | 319 |
317 } // namespace athena | 320 } // namespace athena |
OLD | NEW |