Chromium Code Reviews| Index: ash/shelf/shelf_layout_manager.cc |
| diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc |
| index f13ea079023459d5b94dccd053abe87324ffcd63..d1aeddd4d86c11c28dded762e8c97dac54657935 100644 |
| --- a/ash/shelf/shelf_layout_manager.cc |
| +++ b/ash/shelf/shelf_layout_manager.cc |
| @@ -393,19 +393,21 @@ void ShelfLayoutManager::RemoveObserver(ShelfLayoutManagerObserver* observer) { |
| // ShelfLayoutManager, Gesture functions: |
| void ShelfLayoutManager::OnGestureEdgeSwipe(const ui::GestureEvent& gesture) { |
|
pkotwicz
2014/03/18 14:56:47
Would you be able to replace this entire function
|
| - // Edge swipe should exit fullscreen, show the tray, and disable auto-hide. |
| - |
| - if (workspace_controller_->GetWindowState() == |
| - WORKSPACE_WINDOW_STATE_FULL_SCREEN) { |
| - accelerators::ToggleFullscreen(); |
| + WorkspaceWindowState window_state(workspace_controller_->GetWindowState()); |
| + if (window_state == WORKSPACE_WINDOW_STATE_FULL_SCREEN) { |
| + const aura::Window* fullscreen_window = GetRootWindowController( |
| + root_window_)->GetWindowForFullscreenMode(); |
| + if (wm::GetWindowState(fullscreen_window)->hide_shelf_when_fullscreen()) |
| + return; |
| + } else if (CalculateShelfVisibility() == SHELF_VISIBLE) { |
| + // If the shelf is permanently visible, don't make an effort to display it. |
| + return; |
|
pkotwicz
2014/03/18 14:56:47
With the code as you have it, won't you early retu
zturner
2014/03/18 18:26:36
Hmm, the code works in practice. The relationship
pkotwicz
2014/03/18 19:35:28
Ahh, I understand. This works because you are chec
|
| } |
| - ShelfVisibilityState visibility = CalculateShelfVisibility(); |
| - if (visibility == SHELF_AUTO_HIDE && |
| - CalculateAutoHideState(visibility) == SHELF_AUTO_HIDE_HIDDEN) { |
| - SetState(SHELF_VISIBLE); |
| - SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
| - } |
| + gesture_drag_auto_hide_state_ = SHELF_AUTO_HIDE_SHOWN; |
| + gesture_drag_status_ = GESTURE_DRAG_COMPLETE_IN_PROGRESS; |
| + SetState(SHELF_AUTO_HIDE); |
| + gesture_drag_status_ = GESTURE_DRAG_NONE; |
| } |
| void ShelfLayoutManager::StartGestureDrag(const ui::GestureEvent& gesture) { |