Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(684)

Unified Diff: ash/wm/immersive_fullscreen_controller.cc

Issue 100333004: Fix crash when using touch selection in immersive fullscreen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/wm/immersive_fullscreen_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/immersive_fullscreen_controller.cc
diff --git a/ash/wm/immersive_fullscreen_controller.cc b/ash/wm/immersive_fullscreen_controller.cc
index 4970f4e729f09fad19ec56f2e4db30bc6fa0fa50..28aa1dcd0db5ed2ddc520e669173b743d878810b 100644
--- a/ash/wm/immersive_fullscreen_controller.cc
+++ b/ash/wm/immersive_fullscreen_controller.cc
@@ -289,6 +289,10 @@ void ImmersiveFullscreenController::SetEnabled(bool enabled) {
// Reveal was unsuccessful. Reacquire the revealed locks if appropriate.
UpdateLocatedEventRevealedLock(NULL);
UpdateFocusRevealedLock();
+ } else {
+ // Clearing focus is important because it closes focus-related popups like
+ // the touch selection handles.
+ widget_->GetFocusManager()->ClearFocus();
}
} else {
// Stop cursor-at-top tracking.
@@ -387,7 +391,9 @@ void ImmersiveFullscreenController::OnGestureEvent(ui::GestureEvent* event) {
case ui::ET_GESTURE_SCROLL_BEGIN:
if (ShouldHandleGestureEvent(GetEventLocationInScreen(*event))) {
gesture_begun_ = true;
- event->SetHandled();
+ // Do not consume the event. Otherwise, we end up consuming all
+ // ui::ET_GESTURE_SCROLL_BEGIN events in the top-of-window views
+ // when the top-of-window views are revealed.
}
break;
case ui::ET_GESTURE_SCROLL_UPDATE:
@@ -729,8 +735,10 @@ bool ImmersiveFullscreenController::UpdateRevealedLocksForSwipe(
located_event_revealed_lock_.reset();
focus_revealed_lock_.reset();
- if (reveal_state_ == SLIDING_CLOSED || reveal_state_ == CLOSED)
+ if (reveal_state_ == SLIDING_CLOSED || reveal_state_ == CLOSED) {
+ widget_->GetFocusManager()->ClearFocus();
return true;
+ }
// Ending the reveal was unsuccessful. Reaquire the locks if appropriate.
UpdateLocatedEventRevealedLock(NULL);
« no previous file with comments | « no previous file | ash/wm/immersive_fullscreen_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698