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

Unified Diff: ash/mus/shelf_delegate_mus.cc

Issue 2007003002: mash: Preliminary support for shelf auto-hide (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shutdown
Patch Set: rebase 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_delegate_mus.h ('k') | ash/screen_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/shelf_delegate_mus.cc
diff --git a/ash/mus/shelf_delegate_mus.cc b/ash/mus/shelf_delegate_mus.cc
index 2b11d7cbd04f62e7fef06fe6b0eef135b7ebeb01..3fa2e0e2b6ea8ce501ae8ebd92fc9cba79a7a134 100644
--- a/ash/mus/shelf_delegate_mus.cc
+++ b/ash/mus/shelf_delegate_mus.cc
@@ -193,6 +193,9 @@ ShelfDelegateMus::ShelfDelegateMus(ShelfModel* model)
ShelfDelegateMus::~ShelfDelegateMus() {}
+///////////////////////////////////////////////////////////////////////////////
+// ShelfDelegate:
+
void ShelfDelegateMus::OnShelfCreated(Shelf* shelf) {
SetShelfPreferredSizes(shelf);
}
@@ -225,6 +228,16 @@ void ShelfDelegateMus::OnShelfAutoHideBehaviorChanged(Shelf* shelf) {
});
}
+void ShelfDelegateMus::OnShelfAutoHideStateChanged(Shelf* shelf) {
+ // Push the new preferred size to the window manager. For example, when the
+ // shelf is auto-hidden it becomes a very short "light bar".
+ SetShelfPreferredSizes(shelf);
+}
+
+void ShelfDelegateMus::OnShelfVisibilityStateChanged(Shelf* shelf) {
+ SetShelfPreferredSizes(shelf);
+}
+
ShelfID ShelfDelegateMus::GetShelfIDForAppID(const std::string& app_id) {
if (app_id_to_shelf_id_.count(app_id))
return app_id_to_shelf_id_[app_id];
@@ -254,6 +267,9 @@ void ShelfDelegateMus::UnpinAppWithID(const std::string& app_id) {
NOTIMPLEMENTED();
}
+///////////////////////////////////////////////////////////////////////////////
+// mash::shelf::mojom::ShelfController:
+
void ShelfDelegateMus::AddObserver(
mash::shelf::mojom::ShelfObserverAssociatedPtrInfo observer) {
mash::shelf::mojom::ShelfObserverAssociatedPtr observer_ptr;
@@ -451,7 +467,7 @@ void ShelfDelegateMus::SetShelfPreferredSizes(Shelf* shelf) {
ShelfWidget* widget = shelf->shelf_widget();
ShelfLayoutManager* layout_manager = widget->shelf_layout_manager();
mus::Window* window = aura::GetMusWindow(widget->GetNativeWindow());
- gfx::Size size = layout_manager->GetIdealBounds().size();
+ gfx::Size size = layout_manager->GetPreferredSize();
window->SetSharedProperty<gfx::Size>(
mus::mojom::WindowManager::kPreferredSize_Property, size);
« no previous file with comments | « ash/mus/shelf_delegate_mus.h ('k') | ash/screen_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698