| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/common/shelf/shelf_locking_manager.h" | 5 #include "ash/shelf/shelf_locking_manager.h" |
| 6 | 6 |
| 7 #include "ash/common/session/session_state_delegate.h" | 7 #include "ash/common/session/session_state_delegate.h" |
| 8 #include "ash/common/shelf/wm_shelf.h" | |
| 9 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "ash/shelf/wm_shelf.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 | 12 |
| 13 ShelfLockingManager::ShelfLockingManager(WmShelf* shelf) : shelf_(shelf) { | 13 ShelfLockingManager::ShelfLockingManager(WmShelf* shelf) : shelf_(shelf) { |
| 14 WmShell::Get()->AddLockStateObserver(this); | 14 WmShell::Get()->AddLockStateObserver(this); |
| 15 SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate(); | 15 SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate(); |
| 16 session_locked_ = | 16 session_locked_ = |
| 17 delegate->GetSessionState() != session_manager::SessionState::ACTIVE; | 17 delegate->GetSessionState() != session_manager::SessionState::ACTIVE; |
| 18 screen_locked_ = delegate->IsScreenLocked(); | 18 screen_locked_ = delegate->IsScreenLocked(); |
| 19 delegate->AddSessionStateObserver(this); | 19 delegate->AddSessionStateObserver(this); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 47 const ShelfAlignment alignment = shelf_->GetAlignment(); | 47 const ShelfAlignment alignment = shelf_->GetAlignment(); |
| 48 if (is_locked() && alignment != SHELF_ALIGNMENT_BOTTOM_LOCKED) { | 48 if (is_locked() && alignment != SHELF_ALIGNMENT_BOTTOM_LOCKED) { |
| 49 stored_alignment_ = alignment; | 49 stored_alignment_ = alignment; |
| 50 shelf_->SetAlignment(SHELF_ALIGNMENT_BOTTOM_LOCKED); | 50 shelf_->SetAlignment(SHELF_ALIGNMENT_BOTTOM_LOCKED); |
| 51 } else if (!is_locked() && alignment == SHELF_ALIGNMENT_BOTTOM_LOCKED) { | 51 } else if (!is_locked() && alignment == SHELF_ALIGNMENT_BOTTOM_LOCKED) { |
| 52 shelf_->SetAlignment(stored_alignment_); | 52 shelf_->SetAlignment(stored_alignment_); |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace ash | 56 } // namespace ash |
| OLD | NEW |