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

Unified Diff: ash/wm/gestures/shelf_gesture_handler.cc

Issue 2111443002: mash: Migrate SessionStateDelegate access to WmShell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. 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/wm/gestures/shelf_gesture_handler.cc
diff --git a/ash/wm/gestures/shelf_gesture_handler.cc b/ash/wm/gestures/shelf_gesture_handler.cc
index 61e5a22fe4214f1a82a2a0a17b4aed4e659349ba..9e11783a55d5a645df09e9bc3be1d5a995d5437f 100644
--- a/ash/wm/gestures/shelf_gesture_handler.cc
+++ b/ash/wm/gestures/shelf_gesture_handler.cc
@@ -7,10 +7,10 @@
#include "ash/common/session/session_state_delegate.h"
#include "ash/common/shelf/shelf_types.h"
#include "ash/common/wm/window_state.h"
+#include "ash/common/wm_shell.h"
#include "ash/root_window_controller.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_widget.h"
-#include "ash/shell.h"
#include "ash/system/status_area_widget.h"
#include "ash/wm/window_state_aura.h"
#include "ash/wm/window_util.h"
@@ -29,12 +29,10 @@ ShelfGestureHandler::~ShelfGestureHandler() {}
bool ShelfGestureHandler::ProcessGestureEvent(
const ui::GestureEvent& event,
const aura::Window* event_target_window) {
- Shell* shell = Shell::GetInstance();
- if (!shell->session_state_delegate()->NumberOfLoggedInUsers() ||
- shell->session_state_delegate()->IsScreenLocked()) {
- // The gestures are disabled in the lock/login screen.
+ // The gestures are disabled in the lock/login screen.
+ SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate();
+ if (!delegate->NumberOfLoggedInUsers() || delegate->IsScreenLocked())
return false;
- }
RootWindowController* controller =
RootWindowController::ForWindow(event_target_window);
@@ -47,7 +45,7 @@ bool ShelfGestureHandler::ProcessGestureEvent(
const aura::Window* fullscreen = controller->GetWindowForFullscreenMode();
if (fullscreen &&
- ash::wm::GetWindowState(fullscreen)->hide_shelf_when_fullscreen()) {
+ wm::GetWindowState(fullscreen)->hide_shelf_when_fullscreen()) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698