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/window_manager_impl.h" | 5 #include "athena/wm/window_manager_impl.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/screen/public/screen_manager.h" | 10 #include "athena/screen/public/screen_manager.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } else { | 83 } else { |
84 window->SetBounds(gfx::Rect(work_area)); | 84 window->SetBounds(gfx::Rect(work_area)); |
85 } | 85 } |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 void AthenaContainerLayoutManager::OnWindowAddedToLayout(aura::Window* child) { | 89 void AthenaContainerLayoutManager::OnWindowAddedToLayout(aura::Window* child) { |
90 aura::Window::Windows list = instance->window_list_provider_->GetWindowList(); | 90 aura::Window::Windows list = instance->window_list_provider_->GetWindowList(); |
91 if (std::find(list.begin(), list.end(), child) == list.end()) | 91 if (std::find(list.begin(), list.end(), child) == list.end()) |
92 return; | 92 return; |
93 aura::Window* window = NULL; | 93 gfx::Size size; |
94 if (instance->split_view_controller_->IsSplitViewModeActive()) | 94 if (instance->split_view_controller_->IsSplitViewModeActive()) { |
95 window = instance->split_view_controller_->left_window(); | 95 size = instance->split_view_controller_->left_window()->bounds().size(); |
96 else | 96 } else { |
97 window = instance->container_.get(); | 97 size = |
98 CHECK(window); | 98 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area().size(); |
99 child->SetBounds(gfx::Rect(window->bounds().size())); | 99 } |
| 100 child->SetBounds(gfx::Rect(size)); |
100 } | 101 } |
101 | 102 |
102 void AthenaContainerLayoutManager::OnWillRemoveWindowFromLayout( | 103 void AthenaContainerLayoutManager::OnWillRemoveWindowFromLayout( |
103 aura::Window* child) { | 104 aura::Window* child) { |
104 } | 105 } |
105 | 106 |
106 void AthenaContainerLayoutManager::OnWindowRemovedFromLayout( | 107 void AthenaContainerLayoutManager::OnWindowRemovedFromLayout( |
107 aura::Window* child) { | 108 aura::Window* child) { |
108 } | 109 } |
109 | 110 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 DCHECK(!instance); | 332 DCHECK(!instance); |
332 } | 333 } |
333 | 334 |
334 // static | 335 // static |
335 WindowManager* WindowManager::GetInstance() { | 336 WindowManager* WindowManager::GetInstance() { |
336 DCHECK(instance); | 337 DCHECK(instance); |
337 return instance; | 338 return instance; |
338 } | 339 } |
339 | 340 |
340 } // namespace athena | 341 } // namespace athena |
OLD | NEW |