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" | 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" |
11 #include "ash/shelf/shelf_widget.h" | 11 #include "ash/shelf/shelf_widget.h" |
12 #include "ash/shell.h" | 12 #include "ash/shell.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_properties.h" | 15 #include "ash/wm/window_state.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 namespace internal { | 24 namespace internal { |
25 | 25 |
(...skipping 10 matching lines...) Expand all Loading... |
36 shell->session_state_delegate()->IsScreenLocked()) { | 36 shell->session_state_delegate()->IsScreenLocked()) { |
37 // The gestures are disabled in the lock/login screen. | 37 // The gestures are disabled in the lock/login screen. |
38 return false; | 38 return false; |
39 } | 39 } |
40 | 40 |
41 // TODO(oshima): Find the root window controller from event's location. | 41 // TODO(oshima): Find the root window controller from event's location. |
42 RootWindowController* controller = Shell::GetPrimaryRootWindowController(); | 42 RootWindowController* controller = Shell::GetPrimaryRootWindowController(); |
43 | 43 |
44 ShelfLayoutManager* shelf = controller->GetShelfLayoutManager(); | 44 ShelfLayoutManager* shelf = controller->GetShelfLayoutManager(); |
45 | 45 |
46 // The gesture are disabled for fullscreen windows that are not in immersive | |
47 // mode. | |
48 const aura::Window* fullscreen = controller->GetTopmostFullscreenWindow(); | 46 const aura::Window* fullscreen = controller->GetTopmostFullscreenWindow(); |
49 if (fullscreen && !shelf->FullscreenWithMinimalChrome()) | 47 if (fullscreen && |
| 48 ash::wm::GetWindowState(fullscreen)->hide_shelf_when_fullscreen()) { |
50 return false; | 49 return false; |
| 50 } |
51 | 51 |
52 if (event.type() == ui::ET_GESTURE_SCROLL_BEGIN) { | 52 if (event.type() == ui::ET_GESTURE_SCROLL_BEGIN) { |
53 drag_in_progress_ = true; | 53 drag_in_progress_ = true; |
54 shelf->StartGestureDrag(event); | 54 shelf->StartGestureDrag(event); |
55 return true; | 55 return true; |
56 } | 56 } |
57 | 57 |
58 if (!drag_in_progress_) | 58 if (!drag_in_progress_) |
59 return false; | 59 return false; |
60 | 60 |
(...skipping 22 matching lines...) Expand all Loading... |
83 return true; | 83 return true; |
84 } | 84 } |
85 | 85 |
86 // Unexpected event. Reset the state and let the event fall through. | 86 // Unexpected event. Reset the state and let the event fall through. |
87 shelf->CancelGestureDrag(); | 87 shelf->CancelGestureDrag(); |
88 return false; | 88 return false; |
89 } | 89 } |
90 | 90 |
91 } // namespace internal | 91 } // namespace internal |
92 } // namespace ash | 92 } // namespace ash |
OLD | NEW |