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 3b257b07ca6924122135a75492d13ac5b8cfca8c..a126bb0eb97e0cb367fd71c788d504be9da46f15 100644 |
| --- a/ash/shelf/shelf_layout_manager.cc |
| +++ b/ash/shelf/shelf_layout_manager.cc |
| @@ -389,7 +389,33 @@ void ShelfLayoutManager::RemoveObserver(ShelfLayoutManagerObserver* observer) { |
| } |
| //////////////////////////////////////////////////////////////////////////////// |
| -// ShelfLayoutManager, Gesture dragging: |
| +// ShelfLayoutManager, Gesture functions: |
| + |
| +void ShelfLayoutManager::OnGestureEdgeSwipe(const ui::GestureEvent& gesture) { |
| + // Edge swipe should exit fullscreen, show the tray, and disable auto-hide. |
| + |
| + if (workspace_controller_->GetWindowState() == |
| + WORKSPACE_WINDOW_STATE_FULL_SCREEN) { |
| + const std::vector<aura::Window*> windows = |
| + ash::MruWindowTracker::BuildWindowList(false); |
| + |
| + for (size_t i = 0; i < windows.size(); ++i) { |
| + if (windows[i] && windows[i]->IsVisible() && |
| + root_window_ == windows[i]->GetRootWindow()) { |
| + wm::WindowState* window_state = wm::GetWindowState(windows[i]); |
| + if (window_state->IsFullscreen()) |
| + window_state->ToggleFullscreen(); |
| + } |
| + } |
| + } |
|
sadrul
2014/02/11 21:20:48
Can you use accelerators::ToggleFullscreen() (or s
zturner
2014/02/11 21:30:57
Yes, thank you. This should make the code much cl
|
| + |
| + ShelfVisibilityState visibility = CalculateShelfVisibility(); |
| + if (visibility == SHELF_AUTO_HIDE && |
| + CalculateAutoHideState(visibility) == SHELF_AUTO_HIDE_HIDDEN) { |
| + SetState(SHELF_VISIBLE); |
| + SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
| + } |
| +} |
| void ShelfLayoutManager::StartGestureDrag(const ui::GestureEvent& gesture) { |
| gesture_drag_status_ = GESTURE_DRAG_IN_PROGRESS; |