| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } else { | 94 } else { |
| 95 window->SetBounds(gfx::Rect(work_area)); | 95 window->SetBounds(gfx::Rect(work_area)); |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 } | 98 } |
| 99 | 99 |
| 100 void AthenaContainerLayoutManager::OnWindowAddedToLayout(aura::Window* child) { | 100 void AthenaContainerLayoutManager::OnWindowAddedToLayout(aura::Window* child) { |
| 101 aura::Window::Windows list = instance->window_list_provider_->GetWindowList(); | 101 aura::Window::Windows list = instance->window_list_provider_->GetWindowList(); |
| 102 if (std::find(list.begin(), list.end(), child) == list.end()) | 102 if (std::find(list.begin(), list.end(), child) == list.end()) |
| 103 return; | 103 return; |
| 104 gfx::Size size; | |
| 105 if (instance->split_view_controller_->IsSplitViewModeActive()) { | 104 if (instance->split_view_controller_->IsSplitViewModeActive()) { |
| 106 size = instance->split_view_controller_->left_window()->bounds().size(); | 105 instance->split_view_controller_->ReplaceWindow( |
| 106 instance->split_view_controller_->left_window(), child); |
| 107 } else { | 107 } else { |
| 108 size = | 108 gfx::Size size = |
| 109 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area().size(); | 109 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area().size(); |
| 110 child->SetBounds(gfx::Rect(size)); |
| 110 } | 111 } |
| 111 child->SetBounds(gfx::Rect(size)); | |
| 112 } | 112 } |
| 113 | 113 |
| 114 void AthenaContainerLayoutManager::OnWillRemoveWindowFromLayout( | 114 void AthenaContainerLayoutManager::OnWillRemoveWindowFromLayout( |
| 115 aura::Window* child) { | 115 aura::Window* child) { |
| 116 } | 116 } |
| 117 | 117 |
| 118 void AthenaContainerLayoutManager::OnWindowRemovedFromLayout( | 118 void AthenaContainerLayoutManager::OnWindowRemovedFromLayout( |
| 119 aura::Window* child) { | 119 aura::Window* child) { |
| 120 } | 120 } |
| 121 | 121 |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 DCHECK(!instance); | 375 DCHECK(!instance); |
| 376 } | 376 } |
| 377 | 377 |
| 378 // static | 378 // static |
| 379 WindowManager* WindowManager::GetInstance() { | 379 WindowManager* WindowManager::GetInstance() { |
| 380 DCHECK(instance); | 380 DCHECK(instance); |
| 381 return instance; | 381 return instance; |
| 382 } | 382 } |
| 383 | 383 |
| 384 } // namespace athena | 384 } // namespace athena |
| OLD | NEW |