Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Side by Side Diff: ash/common/wm/always_on_top_controller.cc

Issue 2234033002: mash: Remove WorkspaceLayoutManagerDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common/wm/always_on_top_controller.h" 5 #include "ash/common/wm/always_on_top_controller.h"
6 6
7 #include "ash/common/shell_window_ids.h" 7 #include "ash/common/shell_window_ids.h"
8 #include "ash/common/wm/workspace/workspace_layout_manager.h" 8 #include "ash/common/wm/workspace/workspace_layout_manager.h"
9 #include "ash/common/wm/workspace/workspace_layout_manager_delegate.h"
10 #include "ash/common/wm_window.h" 9 #include "ash/common/wm_window.h"
11 #include "ash/common/wm_window_property.h" 10 #include "ash/common/wm_window_property.h"
12 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
13 12
14 namespace ash { 13 namespace ash {
15 14
16 AlwaysOnTopController::AlwaysOnTopController(WmWindow* viewport) 15 AlwaysOnTopController::AlwaysOnTopController(WmWindow* viewport)
17 : always_on_top_container_(viewport) { 16 : always_on_top_container_(viewport) {
18 always_on_top_container_->SetLayoutManager( 17 always_on_top_container_->SetLayoutManager(
19 base::WrapUnique(new WorkspaceLayoutManager(viewport, nullptr))); 18 base::MakeUnique<WorkspaceLayoutManager>(viewport));
20 // Container should be empty. 19 // Container should be empty.
21 DCHECK(always_on_top_container_->GetChildren().empty()); 20 DCHECK(always_on_top_container_->GetChildren().empty());
22 always_on_top_container_->AddObserver(this); 21 always_on_top_container_->AddObserver(this);
23 } 22 }
24 23
25 AlwaysOnTopController::~AlwaysOnTopController() { 24 AlwaysOnTopController::~AlwaysOnTopController() {
26 if (always_on_top_container_) 25 if (always_on_top_container_)
27 always_on_top_container_->RemoveObserver(this); 26 always_on_top_container_->RemoveObserver(this);
28 } 27 }
29 28
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 67 }
69 68
70 void AlwaysOnTopController::OnWindowDestroying(WmWindow* window) { 69 void AlwaysOnTopController::OnWindowDestroying(WmWindow* window) {
71 if (window == always_on_top_container_) { 70 if (window == always_on_top_container_) {
72 always_on_top_container_->RemoveObserver(this); 71 always_on_top_container_->RemoveObserver(this);
73 always_on_top_container_ = nullptr; 72 always_on_top_container_ = nullptr;
74 } 73 }
75 } 74 }
76 75
77 } // namespace ash 76 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698