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

Side by Side Diff: ash/wm/gestures/shelf_gesture_handler.cc

Issue 14756019: Adding new user menu section to the SystemTrayMenu & refactoring of user access (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/wm/gestures/shelf_gesture_handler.h" 5 #include "ash/wm/gestures/shelf_gesture_handler.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/session_state_delegate.h" 8 #include "ash/session_state_delegate.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_types.h" 10 #include "ash/shelf/shelf_types.h"
(...skipping 13 matching lines...) Expand all
24 24
25 ShelfGestureHandler::ShelfGestureHandler() 25 ShelfGestureHandler::ShelfGestureHandler()
26 : drag_in_progress_(false) { 26 : drag_in_progress_(false) {
27 } 27 }
28 28
29 ShelfGestureHandler::~ShelfGestureHandler() { 29 ShelfGestureHandler::~ShelfGestureHandler() {
30 } 30 }
31 31
32 bool ShelfGestureHandler::ProcessGestureEvent(const ui::GestureEvent& event) { 32 bool ShelfGestureHandler::ProcessGestureEvent(const ui::GestureEvent& event) {
33 Shell* shell = Shell::GetInstance(); 33 Shell* shell = Shell::GetInstance();
34 if (!shell->session_state_delegate()->HasActiveUser() || 34 if (!shell->session_state_delegate()->NumberOfLoggedInUsers() ||
35 shell->session_state_delegate()->IsScreenLocked()) { 35 shell->session_state_delegate()->IsScreenLocked()) {
36 // The gestures are disabled in the lock/login screen. 36 // The gestures are disabled in the lock/login screen.
37 return false; 37 return false;
38 } 38 }
39 39
40 // The gesture are disabled for fullscreen windows. 40 // The gesture are disabled for fullscreen windows.
41 aura::Window* active = wm::GetActiveWindow(); 41 aura::Window* active = wm::GetActiveWindow();
42 if (active && wm::IsWindowFullscreen(active)) 42 if (active && wm::IsWindowFullscreen(active))
43 return false; 43 return false;
44 44
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 return true; 79 return true;
80 } 80 }
81 81
82 // Unexpected event. Reset the state and let the event fall through. 82 // Unexpected event. Reset the state and let the event fall through.
83 shelf->CancelGestureDrag(); 83 shelf->CancelGestureDrag();
84 return false; 84 return false;
85 } 85 }
86 86
87 } // namespace internal 87 } // namespace internal
88 } // namespace ash 88 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698