| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/always_on_top_controller.h" | 5 #include "ash/wm/always_on_top_controller.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "ash/wm/common/workspace/workspace_layout_manager_delegate.h" |
| 9 #include "ash/wm/workspace/workspace_layout_manager.h" | 10 #include "ash/wm/workspace/workspace_layout_manager.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 11 #include "ui/aura/client/aura_constants.h" |
| 11 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
| 12 | 13 |
| 13 namespace ash { | 14 namespace ash { |
| 14 | 15 |
| 15 AlwaysOnTopController::AlwaysOnTopController(aura::Window* viewport) | 16 AlwaysOnTopController::AlwaysOnTopController(aura::Window* viewport) |
| 16 : always_on_top_container_(viewport) { | 17 : always_on_top_container_(viewport) { |
| 17 always_on_top_container_->SetLayoutManager( | 18 always_on_top_container_->SetLayoutManager( |
| 18 new WorkspaceLayoutManager(viewport)); | 19 new WorkspaceLayoutManager(viewport, nullptr)); |
| 19 // Container should be empty. | 20 // Container should be empty. |
| 20 DCHECK(always_on_top_container_->children().empty()); | 21 DCHECK(always_on_top_container_->children().empty()); |
| 21 always_on_top_container_->AddObserver(this); | 22 always_on_top_container_->AddObserver(this); |
| 22 } | 23 } |
| 23 | 24 |
| 24 AlwaysOnTopController::~AlwaysOnTopController() { | 25 AlwaysOnTopController::~AlwaysOnTopController() { |
| 25 if (always_on_top_container_) | 26 if (always_on_top_container_) |
| 26 always_on_top_container_->RemoveObserver(this); | 27 always_on_top_container_->RemoveObserver(this); |
| 27 } | 28 } |
| 28 | 29 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 container->AddChild(window); | 67 container->AddChild(window); |
| 67 } | 68 } |
| 68 } | 69 } |
| 69 | 70 |
| 70 void AlwaysOnTopController::OnWindowDestroyed(aura::Window* window) { | 71 void AlwaysOnTopController::OnWindowDestroyed(aura::Window* window) { |
| 71 if (window == always_on_top_container_) | 72 if (window == always_on_top_container_) |
| 72 always_on_top_container_ = NULL; | 73 always_on_top_container_ = NULL; |
| 73 } | 74 } |
| 74 | 75 |
| 75 } // namespace ash | 76 } // namespace ash |
| OLD | NEW |