| 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/common/session/session_state_delegate.h" | 7 #include "ash/common/session/session_state_delegate.h" |
| 8 #include "ash/common/shelf/shelf_types.h" | 8 #include "ash/common/shelf/shelf_types.h" |
| 9 #include "ash/common/wm/window_state.h" | 9 #include "ash/common/wm/window_state.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| 11 #include "ash/shelf/shelf_layout_manager.h" | 11 #include "ash/shelf/shelf_layout_manager.h" |
| 12 #include "ash/shelf/shelf_widget.h" | 12 #include "ash/shelf/shelf_widget.h" |
| 13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
| 14 #include "ash/system/status_area_widget.h" | 14 #include "ash/system/status_area_widget.h" |
| 15 #include "ash/wm/window_state_aura.h" | 15 #include "ash/wm/window_state_aura.h" |
| 16 #include "ash/wm/window_util.h" | 16 #include "ash/wm/window_util.h" |
| 17 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| 18 #include "ui/compositor/layer.h" | 18 #include "ui/compositor/layer.h" |
| 19 #include "ui/compositor/scoped_layer_animation_settings.h" | 19 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 20 #include "ui/gfx/transform.h" | 20 #include "ui/gfx/transform.h" |
| 21 #include "ui/views/widget/widget.h" | 21 #include "ui/views/widget/widget.h" |
| 22 | 22 |
| 23 namespace ash { | 23 namespace ash { |
| 24 | 24 |
| 25 ShelfGestureHandler::ShelfGestureHandler() | 25 ShelfGestureHandler::ShelfGestureHandler() : drag_in_progress_(false) {} |
| 26 : drag_in_progress_(false) { | |
| 27 } | |
| 28 | 26 |
| 29 ShelfGestureHandler::~ShelfGestureHandler() { | 27 ShelfGestureHandler::~ShelfGestureHandler() {} |
| 30 } | |
| 31 | 28 |
| 32 bool ShelfGestureHandler::ProcessGestureEvent( | 29 bool ShelfGestureHandler::ProcessGestureEvent( |
| 33 const ui::GestureEvent& event, | 30 const ui::GestureEvent& event, |
| 34 const aura::Window* event_target_window) { | 31 const aura::Window* event_target_window) { |
| 35 Shell* shell = Shell::GetInstance(); | 32 Shell* shell = Shell::GetInstance(); |
| 36 if (!shell->session_state_delegate()->NumberOfLoggedInUsers() || | 33 if (!shell->session_state_delegate()->NumberOfLoggedInUsers() || |
| 37 shell->session_state_delegate()->IsScreenLocked()) { | 34 shell->session_state_delegate()->IsScreenLocked()) { |
| 38 // The gestures are disabled in the lock/login screen. | 35 // The gestures are disabled in the lock/login screen. |
| 39 return false; | 36 return false; |
| 40 } | 37 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 shelf->CompleteGestureDrag(event); | 72 shelf->CompleteGestureDrag(event); |
| 76 return true; | 73 return true; |
| 77 } | 74 } |
| 78 | 75 |
| 79 // Unexpected event. Reset the state and let the event fall through. | 76 // Unexpected event. Reset the state and let the event fall through. |
| 80 shelf->CancelGestureDrag(); | 77 shelf->CancelGestureDrag(); |
| 81 return false; | 78 return false; |
| 82 } | 79 } |
| 83 | 80 |
| 84 } // namespace ash | 81 } // namespace ash |
| OLD | NEW |