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

Unified Diff: ash/mus/shelf_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 | « ash/mus/shelf_layout_manager.h ('k') | ash/mus/shelf_layout_manager_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/shelf_layout_manager.cc
diff --git a/mash/wm/shelf_layout_manager.cc b/ash/mus/shelf_layout_manager.cc
similarity index 56%
rename from mash/wm/shelf_layout_manager.cc
rename to ash/mus/shelf_layout_manager.cc
index 50805e47995bc056ce1d07748d05d012df5c00a2..cd4db6bc4256ffffb82416184e9b75606a3feeca 100644
--- a/mash/wm/shelf_layout_manager.cc
+++ b/ash/mus/shelf_layout_manager.cc
@@ -2,47 +2,47 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mash/wm/shelf_layout_manager.h"
+#include "ash/mus/shelf_layout_manager.h"
+#include "ash/mus/property_util.h"
+#include "ash/mus/shelf_layout_manager_delegate.h"
#include "ash/public/interfaces/ash_window_type.mojom.h"
#include "components/mus/public/cpp/window.h"
-#include "mash/wm/property_util.h"
-#include "mash/wm/shelf_layout_manager_delegate.h"
#include "ui/gfx/geometry/rect.h"
-namespace mash {
-namespace wm {
+namespace ash {
+namespace mus {
-ShelfLayoutManager::ShelfLayoutManager(mus::Window* owner,
+ShelfLayoutManager::ShelfLayoutManager(::mus::Window* owner,
ShelfLayoutManagerDelegate* delegate)
: LayoutManager(owner),
delegate_(delegate),
- alignment_(shelf::mojom::Alignment::BOTTOM),
- auto_hide_behavior_(shelf::mojom::AutoHideBehavior::NEVER) {
- AddLayoutProperty(mus::mojom::WindowManager::kPreferredSize_Property);
+ alignment_(mash::shelf::mojom::Alignment::BOTTOM),
+ auto_hide_behavior_(mash::shelf::mojom::AutoHideBehavior::NEVER) {
+ AddLayoutProperty(::mus::mojom::WindowManager::kPreferredSize_Property);
}
ShelfLayoutManager::~ShelfLayoutManager() {}
-mus::Window* ShelfLayoutManager::GetShelfWindow() {
- for (mus::Window* child : owner()->children()) {
- if (GetAshWindowType(child) == ash::mojom::AshWindowType::SHELF)
+::mus::Window* ShelfLayoutManager::GetShelfWindow() {
+ for (::mus::Window* child : owner()->children()) {
+ if (GetAshWindowType(child) == mojom::AshWindowType::SHELF)
return child;
}
return nullptr;
}
-void ShelfLayoutManager::SetAlignment(shelf::mojom::Alignment alignment) {
+void ShelfLayoutManager::SetAlignment(mash::shelf::mojom::Alignment alignment) {
if (alignment_ == alignment)
return;
alignment_ = alignment;
- for (mus::Window* window : owner()->children())
+ for (::mus::Window* window : owner()->children())
LayoutWindow(window);
}
void ShelfLayoutManager::SetAutoHideBehavior(
- shelf::mojom::AutoHideBehavior auto_hide) {
+ mash::shelf::mojom::AutoHideBehavior auto_hide) {
if (auto_hide_behavior_ == auto_hide)
return;
@@ -54,19 +54,19 @@ void ShelfLayoutManager::SetAutoHideBehavior(
// layout as the number of children can vary when the application providing the
// shelf restarts.
-void ShelfLayoutManager::LayoutWindow(mus::Window* window) {
- if (GetAshWindowType(window) != ash::mojom::AshWindowType::SHELF) {
+void ShelfLayoutManager::LayoutWindow(::mus::Window* window) {
+ if (GetAshWindowType(window) != mojom::AshWindowType::SHELF) {
// Phantom windows end up in this container, ignore them.
return;
}
gfx::Size size = GetWindowPreferredSize(window);
- if (alignment_ == shelf::mojom::Alignment::BOTTOM) {
+ if (alignment_ == mash::shelf::mojom::Alignment::BOTTOM) {
const int y = owner()->bounds().height() - size.height();
size.set_width(owner()->bounds().width());
window->SetBounds(gfx::Rect(0, y, size.width(), size.height()));
} else {
- const int x = (alignment_ == shelf::mojom::Alignment::LEFT)
+ const int x = (alignment_ == mash::shelf::mojom::Alignment::LEFT)
? 0
: (owner()->bounds().width() - size.width());
size.set_height(owner()->bounds().height());
@@ -74,10 +74,10 @@ void ShelfLayoutManager::LayoutWindow(mus::Window* window) {
}
}
-void ShelfLayoutManager::WindowAdded(mus::Window* window) {
- if (GetAshWindowType(window) == ash::mojom::AshWindowType::SHELF)
+void ShelfLayoutManager::WindowAdded(::mus::Window* window) {
+ if (GetAshWindowType(window) == mojom::AshWindowType::SHELF)
delegate_->OnShelfWindowAvailable();
}
-} // namespace wm
-} // namespace mash
+} // namespace mus
+} // namespace ash
« no previous file with comments | « ash/mus/shelf_layout_manager.h ('k') | ash/mus/shelf_layout_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698