| 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/shelf/shelf_locking_manager.h" | 5 #include "ash/shelf/shelf_locking_manager.h" |
| 6 | 6 |
| 7 #include "ash/session/session_state_delegate.h" | 7 #include "ash/session/session_state_delegate.h" |
| 8 #include "ash/shelf/shelf.h" | 8 #include "ash/shelf/shelf.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/wm/lock_state_controller.h" | 10 #include "ash/wm/lock_state_controller.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 UpdateLockedState(); | 40 UpdateLockedState(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void ShelfLockingManager::OnLockStateEvent(EventType event) { | 43 void ShelfLockingManager::OnLockStateEvent(EventType event) { |
| 44 // Lock when the animation starts, ignoring pre-lock. There's no unlock event. | 44 // Lock when the animation starts, ignoring pre-lock. There's no unlock event. |
| 45 screen_locked_ |= event == EVENT_LOCK_ANIMATION_STARTED; | 45 screen_locked_ |= event == EVENT_LOCK_ANIMATION_STARTED; |
| 46 UpdateLockedState(); | 46 UpdateLockedState(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void ShelfLockingManager::UpdateLockedState() { | 49 void ShelfLockingManager::UpdateLockedState() { |
| 50 const wm::ShelfAlignment alignment = shelf_->alignment(); | 50 const ShelfAlignment alignment = shelf_->alignment(); |
| 51 if (is_locked() && alignment != wm::SHELF_ALIGNMENT_BOTTOM_LOCKED) { | 51 if (is_locked() && alignment != SHELF_ALIGNMENT_BOTTOM_LOCKED) { |
| 52 stored_alignment_ = alignment; | 52 stored_alignment_ = alignment; |
| 53 shelf_->SetAlignment(wm::SHELF_ALIGNMENT_BOTTOM_LOCKED); | 53 shelf_->SetAlignment(SHELF_ALIGNMENT_BOTTOM_LOCKED); |
| 54 } else if (!is_locked() && alignment == wm::SHELF_ALIGNMENT_BOTTOM_LOCKED) { | 54 } else if (!is_locked() && alignment == SHELF_ALIGNMENT_BOTTOM_LOCKED) { |
| 55 shelf_->SetAlignment(stored_alignment_); | 55 shelf_->SetAlignment(stored_alignment_); |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 | 58 |
| 59 } // namespace ash | 59 } // namespace ash |
| OLD | NEW |