Chromium Code Reviews| Index: ash/wm/immersive_fullscreen_controller.cc |
| diff --git a/ash/wm/immersive_fullscreen_controller.cc b/ash/wm/immersive_fullscreen_controller.cc |
| index 9b21269c02e2198394f535a95c9ec9973e8bec3c..c0d729d9a764e1535dba53c29d285ea6b79fcb2d 100644 |
| --- a/ash/wm/immersive_fullscreen_controller.cc |
| +++ b/ash/wm/immersive_fullscreen_controller.cc |
| @@ -62,13 +62,6 @@ const int kSwipeVerticalThresholdMultiplier = 3; |
| // See ShouldIgnoreMouseEventAtLocation() for more details. |
| const int kHeightOfDeadRegionAboveTopContainer = 10; |
| -// The height in pixels of the region below the top edge of the display in which |
| -// the mouse can trigger revealing the top-of-window views. The height must be |
| -// greater than 1px because the top pixel is used to trigger moving the cursor |
| -// between displays if the user has a vertical display layout (primary display |
| -// above/below secondary display). |
| -const int kMouseRevealBoundsHeight = 3; |
| - |
| // Returns the BubbleDelegateView corresponding to |maybe_bubble| if |
| // |maybe_bubble| is a bubble. |
| views::BubbleDelegateView* AsBubbleDelegate(aura::Window* maybe_bubble) { |
| @@ -111,6 +104,20 @@ gfx::Rect GetDisplayBoundsInScreen(aura::Window* window) { |
| } // namespace |
| +// The height in pixels of the region below the top edge of the display in which |
| +// the mouse can trigger revealing the top-of-window views. The height must be |
|
pkotwicz
2014/03/13 18:08:45
The part of this comment starting with: "The heigh
pkotwicz
2014/03/14 05:08:27
You still need to address this comment?
zturner
2014/03/17 21:15:59
Done. Also, you are correct. Windows Ash (and me
|
| +// greater than 1px because the top pixel is used to trigger moving the cursor |
| +// between displays if the user has a vertical display layout (primary display |
| +// above/below secondary display). |
| +#if defined(OS_WIN) |
| +// Windows 8 reserves some pixels at the top of the screen for the hand icon |
| +// that allows you to drag a metro app off the screen, so a few additional |
| +// pixels of space must be reserved for the mouse reveal. |
| +const int ImmersiveFullscreenController::kMouseRevealBoundsHeight = 9; |
| +#else |
| +const int ImmersiveFullscreenController::kMouseRevealBoundsHeight = 3; |
| +#endif |
| + |
| //////////////////////////////////////////////////////////////////////////////// |
| // Class which keeps the top-of-window views revealed as long as one of the |
| @@ -397,6 +404,12 @@ void ImmersiveFullscreenController::OnGestureEvent(ui::GestureEvent* event) { |
| return; |
| switch (event->type()) { |
| +#if defined(OS_WIN) |
| + case ui::ET_GESTURE_WIN8_EDGE_SWIPE: |
| + UpdateRevealedLocksForSwipe(GetSwipeType(event)); |
| + event->SetHandled(); |
| + break; |
| +#endif |
| case ui::ET_GESTURE_SCROLL_BEGIN: |
| if (ShouldHandleGestureEvent(GetEventLocationInScreen(*event))) { |
| gesture_begun_ = true; |
| @@ -789,6 +802,7 @@ void ImmersiveFullscreenController::MaybeStartReveal(Animate animate) { |
| RevealState previous_reveal_state = reveal_state_; |
| reveal_state_ = SLIDING_OPEN; |
| + |
| if (previous_reveal_state == CLOSED) { |
| delegate_->OnImmersiveRevealStarted(); |
| @@ -850,6 +864,10 @@ void ImmersiveFullscreenController::OnSlideClosedAnimationCompleted() { |
| ImmersiveFullscreenController::SwipeType |
| ImmersiveFullscreenController::GetSwipeType(ui::GestureEvent* event) const { |
| +#if defined(OS_WIN) |
| + if (event->type() == ui::ET_GESTURE_WIN8_EDGE_SWIPE) |
| + return SWIPE_OPEN; |
| +#endif |
| if (event->type() != ui::ET_GESTURE_SCROLL_UPDATE) |
| return SWIPE_NONE; |
| // Make sure that it is a clear vertical gesture. |