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

Unified Diff: ash/wm/common/always_on_top_controller.cc

Issue 2030593002: Renames ash/wm/common into ash/common/wm (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/common/always_on_top_controller.h ('k') | ash/wm/common/ash_wm_common.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/common/always_on_top_controller.cc
diff --git a/ash/wm/common/always_on_top_controller.cc b/ash/wm/common/always_on_top_controller.cc
deleted file mode 100644
index 34042e5f810f03abb7d984fd15b80a1634db23ae..0000000000000000000000000000000000000000
--- a/ash/wm/common/always_on_top_controller.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/wm/common/always_on_top_controller.h"
-
-#include "ash/wm/common/wm_shell_window_ids.h"
-#include "ash/wm/common/wm_window.h"
-#include "ash/wm/common/wm_window_property.h"
-#include "ash/wm/common/workspace/workspace_layout_manager.h"
-#include "ash/wm/common/workspace/workspace_layout_manager_delegate.h"
-#include "base/memory/ptr_util.h"
-
-namespace ash {
-
-AlwaysOnTopController::AlwaysOnTopController(wm::WmWindow* viewport)
- : always_on_top_container_(viewport) {
- always_on_top_container_->SetLayoutManager(
- base::WrapUnique(new WorkspaceLayoutManager(viewport, nullptr)));
- // Container should be empty.
- DCHECK(always_on_top_container_->GetChildren().empty());
- always_on_top_container_->AddObserver(this);
-}
-
-AlwaysOnTopController::~AlwaysOnTopController() {
- if (always_on_top_container_)
- always_on_top_container_->RemoveObserver(this);
-}
-
-wm::WmWindow* AlwaysOnTopController::GetContainer(wm::WmWindow* window) const {
- DCHECK(always_on_top_container_);
- if (window->GetBoolProperty(wm::WmWindowProperty::ALWAYS_ON_TOP))
- return always_on_top_container_;
- return always_on_top_container_->GetRootWindow()->GetChildByShellWindowId(
- kShellWindowId_DefaultContainer);
-}
-
-// TODO(rsadam@): Refactor so that this cast is unneeded.
-WorkspaceLayoutManager* AlwaysOnTopController::GetLayoutManager() const {
- return static_cast<WorkspaceLayoutManager*>(
- always_on_top_container_->GetLayoutManager());
-}
-
-void AlwaysOnTopController::SetLayoutManagerForTest(
- std::unique_ptr<WorkspaceLayoutManager> layout_manager) {
- always_on_top_container_->SetLayoutManager(std::move(layout_manager));
-}
-
-void AlwaysOnTopController::OnWindowTreeChanged(
- wm::WmWindow* window,
- const TreeChangeParams& params) {
- if (params.old_parent == always_on_top_container_)
- params.target->RemoveObserver(this);
- else if (params.new_parent == always_on_top_container_)
- params.target->AddObserver(this);
-}
-
-void AlwaysOnTopController::OnWindowPropertyChanged(
- wm::WmWindow* window,
- wm::WmWindowProperty property) {
- if (window != always_on_top_container_ &&
- property == wm::WmWindowProperty::ALWAYS_ON_TOP) {
- DCHECK(window->GetType() == ui::wm::WINDOW_TYPE_NORMAL ||
- window->GetType() == ui::wm::WINDOW_TYPE_POPUP);
- wm::WmWindow* container = GetContainer(window);
- if (window->GetParent() != container)
- container->AddChild(window);
- }
-}
-
-void AlwaysOnTopController::OnWindowDestroying(wm::WmWindow* window) {
- if (window == always_on_top_container_) {
- always_on_top_container_->RemoveObserver(this);
- always_on_top_container_ = nullptr;
- }
-}
-
-} // namespace ash
« no previous file with comments | « ash/wm/common/always_on_top_controller.h ('k') | ash/wm/common/ash_wm_common.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698