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

Unified Diff: ash/common/accelerators/accelerator_controller.cc

Issue 2734933004: ash: Use SessionController instead of SessionStateDelegate (Closed)
Patch Set: rebase to get WorkspaceLayoutManagerSoloTest change Created 3 years, 9 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/accelerators/accelerator_controller.cc
diff --git a/ash/common/accelerators/accelerator_controller.cc b/ash/common/accelerators/accelerator_controller.cc
index ac5cf4645bd28095a921209b3240fbee54cd886f..0e8cb95e5b82a79a9c3f3827f3df42ce99bb5917 100644
--- a/ash/common/accelerators/accelerator_controller.cc
+++ b/ash/common/accelerators/accelerator_controller.cc
@@ -17,7 +17,7 @@
#include "ash/common/multi_profile_uma.h"
#include "ash/common/new_window_controller.h"
#include "ash/common/palette_delegate.h"
-#include "ash/common/session/session_state_delegate.h"
+#include "ash/common/session/session_controller.h"
#include "ash/common/shelf/shelf_widget.h"
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/shell_delegate.h"
@@ -85,7 +85,7 @@ class DeprecatedAcceleratorNotificationDelegate
bool HasClickedListener() override { return true; }
void Click() override {
- if (!WmShell::Get()->GetSessionStateDelegate()->IsUserSessionBlocked())
+ if (!WmShell::Get()->session_controller()->IsUserSessionBlocked())
Shell::Get()->shell_delegate()->OpenKeyboardShortcutHelpPage();
}
@@ -501,12 +501,12 @@ void HandleGetHelp() {
}
bool CanHandleLock() {
- return WmShell::Get()->GetSessionStateDelegate()->CanLockScreen();
+ return WmShell::Get()->session_controller()->CanLockScreen();
}
void HandleLock() {
base::RecordAction(UserMetricsAction("Accel_LockScreen_L"));
- WmShell::Get()->GetSessionStateDelegate()->LockScreen();
+ WmShell::Get()->session_controller()->LockScreen();
}
void HandleShowStylusTools() {
@@ -533,7 +533,7 @@ void HandleSuspend() {
bool CanHandleCycleUser() {
return Shell::Get()->shell_delegate()->IsMultiProfilesEnabled() &&
- WmShell::Get()->GetSessionStateDelegate()->NumberOfLoggedInUsers() > 1;
+ WmShell::Get()->session_controller()->NumberOfLoggedInUsers() > 1;
}
void HandleCycleUser(CycleUserDirection direction) {
@@ -547,7 +547,7 @@ void HandleCycleUser(CycleUserDirection direction) {
base::RecordAction(UserMetricsAction("Accel_Switch_To_Previous_User"));
break;
}
- WmShell::Get()->GetSessionStateDelegate()->CycleActiveUser(direction);
+ WmShell::Get()->session_controller()->CycleActiveUser(direction);
}
bool CanHandleToggleCapsLock(const ui::Accelerator& accelerator,
@@ -1227,13 +1227,12 @@ AcceleratorController::GetAcceleratorProcessingRestriction(int action) {
actions_allowed_in_pinned_mode_.end()) {
return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION;
}
- // TODO(xiyuan): Replace with SessionController. http://crbug.com/648964
- if (!wm_shell->GetSessionStateDelegate()->IsActiveUserSessionStarted() &&
+ if (!wm_shell->session_controller()->IsActiveUserSessionStarted() &&
actions_allowed_at_login_screen_.find(action) ==
actions_allowed_at_login_screen_.end()) {
return RESTRICTION_PREVENT_PROCESSING;
}
- if (wm_shell->GetSessionStateDelegate()->IsScreenLocked() &&
+ if (wm_shell->session_controller()->IsScreenLocked() &&
actions_allowed_at_lock_screen_.find(action) ==
actions_allowed_at_lock_screen_.end()) {
return RESTRICTION_PREVENT_PROCESSING;
« no previous file with comments | « ash/accelerators/accelerator_interactive_uitest_chromeos.cc ('k') | ash/common/session/session_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698