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

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: Fix linux build breakage 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
Index: ash/shelf/shelf_layout_manager.cc
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 4757e88f73fb9edf15034e6399e773f71968ae91..8bc641fa75610dc268aafd28a8afc8a825406f86 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 (state_.is_pinned) {
+ 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,11 @@ void ShelfLayoutManager::OnShelfAutoHideBehaviorChanged(WmWindow* root_window) {
UpdateVisibilityState();
}
+void ShelfLayoutManager::OnPinnedStateChanged(WmWindow* pinned_window) {
+ state_.is_pinned = pinned_window->GetWindowState()->IsPinned();
+ UpdateVisibilityState();
+}
+
void ShelfLayoutManager::OnWindowActivated(
aura::client::ActivationChangeObserver::ActivationReason reason,
aura::Window* gained_active,
@@ -586,6 +593,7 @@ void ShelfLayoutManager::SetState(ShelfVisibilityState visibility_state) {
// Preserve the log in screen states.
state.is_adding_user_screen = state_.is_adding_user_screen;
state.is_screen_locked = state_.is_screen_locked;
+ state.is_pinned = state_.is_pinned;
// Force an update because gesture drags affect the shelf bounds and we
// should animate back to the normal bounds at the end of a gesture.

Powered by Google App Engine
This is Rietveld 408576698