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

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

Issue 2814243002: Removes a couple more functions from WmWindow (Closed)
Patch Set: feedback Created 3 years, 8 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
« no previous file with comments | « ash/wallpaper/wallpaper_controller_unittest.cc ('k') | ash/wm/container_finder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/wm/always_on_top_controller.h" 5 #include "ash/wm/always_on_top_controller.h"
6 6
7 #include "ash/public/cpp/shell_window_ids.h" 7 #include "ash/public/cpp/shell_window_ids.h"
8 #include "ash/wm/workspace/workspace_layout_manager.h" 8 #include "ash/wm/workspace/workspace_layout_manager.h"
9 #include "ash/wm_window.h" 9 #include "ash/wm_window.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "ui/aura/client/aura_constants.h" 11 #include "ui/aura/client/aura_constants.h"
12 #include "ui/aura/window.h" 12 #include "ui/aura/window.h"
13 13
14 namespace ash { 14 namespace ash {
15 15
16 AlwaysOnTopController::AlwaysOnTopController(WmWindow* viewport) 16 AlwaysOnTopController::AlwaysOnTopController(WmWindow* viewport)
17 : always_on_top_container_(viewport) { 17 : always_on_top_container_(viewport) {
18 DCHECK_NE(kShellWindowId_DefaultContainer, viewport->GetShellWindowId()); 18 DCHECK_NE(kShellWindowId_DefaultContainer, viewport->aura_window()->id());
19 always_on_top_container_->SetLayoutManager( 19 always_on_top_container_->SetLayoutManager(
20 base::MakeUnique<WorkspaceLayoutManager>(viewport)); 20 base::MakeUnique<WorkspaceLayoutManager>(viewport));
21 // Container should be empty. 21 // Container should be empty.
22 DCHECK(always_on_top_container_->GetChildren().empty()); 22 DCHECK(always_on_top_container_->GetChildren().empty());
23 always_on_top_container_->aura_window()->AddObserver(this); 23 always_on_top_container_->aura_window()->AddObserver(this);
24 } 24 }
25 25
26 AlwaysOnTopController::~AlwaysOnTopController() { 26 AlwaysOnTopController::~AlwaysOnTopController() {
27 if (always_on_top_container_) 27 if (always_on_top_container_)
28 always_on_top_container_->aura_window()->RemoveObserver(this); 28 always_on_top_container_->aura_window()->RemoveObserver(this);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 void AlwaysOnTopController::OnWindowDestroying(aura::Window* window) { 71 void AlwaysOnTopController::OnWindowDestroying(aura::Window* window) {
72 if (WmWindow::Get(window) == always_on_top_container_) { 72 if (WmWindow::Get(window) == always_on_top_container_) {
73 always_on_top_container_->aura_window()->RemoveObserver(this); 73 always_on_top_container_->aura_window()->RemoveObserver(this);
74 always_on_top_container_ = nullptr; 74 always_on_top_container_ = nullptr;
75 } 75 }
76 } 76 }
77 77
78 } // namespace ash 78 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wallpaper/wallpaper_controller_unittest.cc ('k') | ash/wm/container_finder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698