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

Unified Diff: ash/common/shelf/shelf_locking_manager.cc

Issue 2166043003: mash: Migrate ShelfLockingManager to ash/common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move ShelfLockingManager test access to Shelf. Created 4 years, 5 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/common/shelf/shelf_locking_manager.cc
diff --git a/ash/shelf/shelf_locking_manager.cc b/ash/common/shelf/shelf_locking_manager.cc
similarity index 79%
rename from ash/shelf/shelf_locking_manager.cc
rename to ash/common/shelf/shelf_locking_manager.cc
index 62f27e497a2d4d37cdac8100a2b010d53ccb78bb..05cc9ac9b34ea4edfc2683e373840a9be8a7a1a8 100644
--- a/ash/shelf/shelf_locking_manager.cc
+++ b/ash/common/shelf/shelf_locking_manager.cc
@@ -2,19 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/shelf/shelf_locking_manager.h"
+#include "ash/common/shelf/shelf_locking_manager.h"
#include "ash/common/session/session_state_delegate.h"
+#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/wm_shell.h"
-#include "ash/shelf/shelf.h"
-#include "ash/shell.h"
-#include "ash/wm/lock_state_controller.h"
namespace ash {
-ShelfLockingManager::ShelfLockingManager(Shelf* shelf) : shelf_(shelf) {
- Shell* shell = Shell::GetInstance();
- shell->lock_state_controller()->AddObserver(this);
+ShelfLockingManager::ShelfLockingManager(WmShelf* shelf) : shelf_(shelf) {
+ WmShell::Get()->AddLockStateObserver(this);
SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate();
session_locked_ =
delegate->GetSessionState() != SessionStateDelegate::SESSION_STATE_ACTIVE;
@@ -24,7 +21,7 @@ ShelfLockingManager::ShelfLockingManager(Shelf* shelf) : shelf_(shelf) {
}
ShelfLockingManager::~ShelfLockingManager() {
- Shell::GetInstance()->lock_state_controller()->RemoveObserver(this);
+ WmShell::Get()->RemoveLockStateObserver(this);
WmShell::Get()->GetSessionStateDelegate()->RemoveSessionStateObserver(this);
WmShell::Get()->RemoveShellObserver(this);
}
@@ -47,7 +44,7 @@ void ShelfLockingManager::OnLockStateEvent(EventType event) {
}
void ShelfLockingManager::UpdateLockedState() {
- const ShelfAlignment alignment = shelf_->alignment();
+ const ShelfAlignment alignment = shelf_->GetAlignment();
if (is_locked() && alignment != SHELF_ALIGNMENT_BOTTOM_LOCKED) {
stored_alignment_ = alignment;
shelf_->SetAlignment(SHELF_ALIGNMENT_BOTTOM_LOCKED);

Powered by Google App Engine
This is Rietveld 408576698