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

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

Issue 1997633004: Removes |old| parameter from OnWindowPropertyChanged() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/wm/common/always_on_top_controller.h" 5 #include "ash/wm/common/always_on_top_controller.h"
6 6
7 #include "ash/wm/common/wm_shell_window_ids.h" 7 #include "ash/wm/common/wm_shell_window_ids.h"
8 #include "ash/wm/common/wm_window.h" 8 #include "ash/wm/common/wm_window.h"
9 #include "ash/wm/common/wm_window_property.h" 9 #include "ash/wm/common/wm_window_property.h"
10 #include "ash/wm/common/workspace/workspace_layout_manager.h" 10 #include "ash/wm/common/workspace/workspace_layout_manager.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 wm::WmWindow* window, 50 wm::WmWindow* window,
51 const TreeChangeParams& params) { 51 const TreeChangeParams& params) {
52 if (params.old_parent == always_on_top_container_) 52 if (params.old_parent == always_on_top_container_)
53 params.target->RemoveObserver(this); 53 params.target->RemoveObserver(this);
54 else if (params.new_parent == always_on_top_container_) 54 else if (params.new_parent == always_on_top_container_)
55 params.target->AddObserver(this); 55 params.target->AddObserver(this);
56 } 56 }
57 57
58 void AlwaysOnTopController::OnWindowPropertyChanged( 58 void AlwaysOnTopController::OnWindowPropertyChanged(
59 wm::WmWindow* window, 59 wm::WmWindow* window,
60 wm::WmWindowProperty property, 60 wm::WmWindowProperty property) {
61 intptr_t old) {
62 if (window != always_on_top_container_ && 61 if (window != always_on_top_container_ &&
63 property == wm::WmWindowProperty::ALWAYS_ON_TOP) { 62 property == wm::WmWindowProperty::ALWAYS_ON_TOP) {
64 DCHECK(window->GetType() == ui::wm::WINDOW_TYPE_NORMAL || 63 DCHECK(window->GetType() == ui::wm::WINDOW_TYPE_NORMAL ||
65 window->GetType() == ui::wm::WINDOW_TYPE_POPUP); 64 window->GetType() == ui::wm::WINDOW_TYPE_POPUP);
66 wm::WmWindow* container = GetContainer(window); 65 wm::WmWindow* container = GetContainer(window);
67 if (window->GetParent() != container) 66 if (window->GetParent() != container)
68 container->AddChild(window); 67 container->AddChild(window);
69 } 68 }
70 } 69 }
71 70
72 void AlwaysOnTopController::OnWindowDestroying(wm::WmWindow* window) { 71 void AlwaysOnTopController::OnWindowDestroying(wm::WmWindow* window) {
73 if (window == always_on_top_container_) { 72 if (window == always_on_top_container_) {
74 always_on_top_container_->RemoveObserver(this); 73 always_on_top_container_->RemoveObserver(this);
75 always_on_top_container_ = nullptr; 74 always_on_top_container_ = nullptr;
76 } 75 }
77 } 76 }
78 77
79 } // namespace ash 78 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698