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

Unified Diff: mash/wm/layout_manager.cc

Issue 2029883002: Moves mash/wm into ash/mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_static_assert
Patch Set: move comment 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 | « mash/wm/layout_manager.h ('k') | mash/wm/layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/wm/layout_manager.cc
diff --git a/mash/wm/layout_manager.cc b/mash/wm/layout_manager.cc
deleted file mode 100644
index 1edef0aa345fc89aa833e699fb85ccc35b544ddb..0000000000000000000000000000000000000000
--- a/mash/wm/layout_manager.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2015 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 "mash/wm/layout_manager.h"
-
-#include <stdint.h>
-
-#include "components/mus/public/cpp/property_type_converters.h"
-#include "components/mus/public/cpp/window.h"
-#include "components/mus/public/cpp/window_property.h"
-
-namespace mash {
-namespace wm {
-
-LayoutManager::~LayoutManager() {
- Uninstall();
-}
-
-LayoutManager::LayoutManager(mus::Window* owner) : owner_(owner) {
- owner_->AddObserver(this);
- DCHECK(owner->children().empty());
-}
-
-void LayoutManager::Uninstall() {
- if (!owner_)
- return;
- owner_->RemoveObserver(this);
- for (auto child : owner_->children())
- child->RemoveObserver(this);
- owner_ = nullptr;
-}
-
-void LayoutManager::OnTreeChanged(
- const mus::WindowObserver::TreeChangeParams& params) {
- DCHECK(params.target);
- if (params.new_parent == owner_) {
- // params.target was added to the layout.
- WindowAdded(params.target);
- params.target->AddObserver(this);
- LayoutWindow(params.target);
- } else if (params.old_parent == owner_) {
- // params.target was removed from the layout.
- params.target->RemoveObserver(this);
- WindowRemoved(params.target);
- }
-}
-
-void LayoutManager::OnWindowDestroying(mus::Window* window) {
- if (owner_ == window)
- Uninstall();
-}
-
-void LayoutManager::OnWindowBoundsChanged(mus::Window* window,
- const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) {
- if (window != owner_)
- return;
-
- // Changes to the container's bounds require all windows to be laid out.
- for (auto child : window->children())
- LayoutWindow(child);
-}
-
-void LayoutManager::OnWindowSharedPropertyChanged(
- mus::Window* window,
- const std::string& name,
- const std::vector<uint8_t>* old_data,
- const std::vector<uint8_t>* new_data) {
- if (window == owner_)
- return;
-
- // Changes to the following properties require the window to be laid out.
- if (layout_properties_.count(name) > 0)
- LayoutWindow(window);
-}
-
-void LayoutManager::WindowAdded(mus::Window* window) {}
-void LayoutManager::WindowRemoved(mus::Window* window) {}
-
-void LayoutManager::AddLayoutProperty(const std::string& name) {
- layout_properties_.insert(name);
-}
-
-} // namespace wm
-} // namespace mash
« no previous file with comments | « mash/wm/layout_manager.h ('k') | mash/wm/layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698