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

Unified Diff: mash/wm/shelf_layout_manager.cc

Issue 1991553002: Creates mus implementation of WmShelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: private 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/shelf_layout_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/wm/shelf_layout_manager.cc
diff --git a/mash/wm/shelf_layout_manager.cc b/mash/wm/shelf_layout_manager.cc
index f26522d53f5e6b4d0abb79a1a9a4e5655e422ec4..44fb732b40bd848e4b1675d43a870094612c0e5c 100644
--- a/mash/wm/shelf_layout_manager.cc
+++ b/mash/wm/shelf_layout_manager.cc
@@ -14,13 +14,21 @@ namespace wm {
ShelfLayoutManager::ShelfLayoutManager(mus::Window* owner)
: LayoutManager(owner),
- alignment_(mash::shelf::mojom::Alignment::BOTTOM),
- auto_hide_behavior_(mash::shelf::mojom::AutoHideBehavior::NEVER) {
+ alignment_(shelf::mojom::Alignment::BOTTOM),
+ auto_hide_behavior_(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) == mojom::AshWindowType::SHELF)
+ return child;
+ }
+ return nullptr;
+}
+
// We explicitly don't make assertions about the number of children in this
// layout as the number of children can vary when the application providing the
// shelf restarts.
@@ -32,12 +40,12 @@ void ShelfLayoutManager::LayoutWindow(mus::Window* window) {
}
gfx::Size size = GetWindowPreferredSize(window);
- if (alignment_ == mash::shelf::mojom::Alignment::BOTTOM) {
+ if (alignment_ == 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_ == mash::shelf::mojom::Alignment::LEFT)
+ const int x = (alignment_ == shelf::mojom::Alignment::LEFT)
? 0
: (owner()->bounds().width() - size.width());
size.set_height(owner()->bounds().height());
@@ -45,7 +53,7 @@ void ShelfLayoutManager::LayoutWindow(mus::Window* window) {
}
}
-void ShelfLayoutManager::SetAlignment(mash::shelf::mojom::Alignment alignment) {
+void ShelfLayoutManager::SetAlignment(shelf::mojom::Alignment alignment) {
if (alignment_ == alignment)
return;
@@ -55,7 +63,7 @@ void ShelfLayoutManager::SetAlignment(mash::shelf::mojom::Alignment alignment) {
}
void ShelfLayoutManager::SetAutoHideBehavior(
- mash::shelf::mojom::AutoHideBehavior auto_hide) {
+ shelf::mojom::AutoHideBehavior auto_hide) {
if (auto_hide_behavior_ == auto_hide)
return;
« no previous file with comments | « mash/wm/shelf_layout_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698