OLD | NEW |
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" | |
9 #include "ash/shelf/shelf_layout_manager.h" | 8 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shelf/shelf_types.h" | 9 #include "ash/shelf/shelf_types.h" |
11 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
12 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/shell_delegate.h" |
13 #include "ash/system/status_area_widget.h" | 13 #include "ash/system/status_area_widget.h" |
14 #include "ash/wm/gestures/tray_gesture_handler.h" | 14 #include "ash/wm/gestures/tray_gesture_handler.h" |
15 #include "ash/wm/window_util.h" | 15 #include "ash/wm/window_util.h" |
16 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
17 #include "ui/compositor/layer.h" | 17 #include "ui/compositor/layer.h" |
18 #include "ui/compositor/scoped_layer_animation_settings.h" | 18 #include "ui/compositor/scoped_layer_animation_settings.h" |
19 #include "ui/gfx/transform.h" | 19 #include "ui/gfx/transform.h" |
20 #include "ui/views/widget/widget.h" | 20 #include "ui/views/widget/widget.h" |
21 | 21 |
22 namespace ash { | 22 namespace ash { |
23 namespace internal { | 23 namespace internal { |
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->delegate()->IsUserLoggedIn() || |
35 shell->session_state_delegate()->IsScreenLocked()) { | 35 shell->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 |
45 // TODO(oshima): Find the root window controller from event's location. | 45 // TODO(oshima): Find the root window controller from event's location. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |