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

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 2072853002: Implement "pinned" mode in ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 6 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/shelf/shelf_layout_manager.h ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_layout_manager.cc
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 1376d72dcc47cd2968021b137a46179239242ad9..78800a3823ba7d1edf0c239375f9e456e95f1fd2 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -313,6 +313,8 @@ void ShelfLayoutManager::UpdateVisibilityState() {
if (state_.is_screen_locked || state_.is_adding_user_screen) {
SetState(SHELF_VISIBLE);
+ } else if (WmShell::Get()->IsPinned()) {
+ SetState(SHELF_HIDDEN);
} else {
// TODO(zelidrag): Verify shelf drag animation still shows on the device
// when we are in SHELF_AUTO_HIDE_ALWAYS_HIDDEN.
@@ -549,6 +551,12 @@ void ShelfLayoutManager::OnShelfAutoHideBehaviorChanged(WmWindow* root_window) {
UpdateVisibilityState();
}
+void ShelfLayoutManager::OnPinnedStateChanged(WmWindow* pinned_window) {
+ // Shelf needs to be hidden on entering to pinned mode, or restored
+ // on exiting from pinned mode.
+ UpdateVisibilityState();
+}
+
void ShelfLayoutManager::OnWindowActivated(
aura::client::ActivationChangeObserver::ActivationReason reason,
aura::Window* gained_active,
« no previous file with comments | « ash/shelf/shelf_layout_manager.h ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698