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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/wm/immersive_fullscreen_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/immersive_fullscreen_controller.h" 5 #include "ash/wm/immersive_fullscreen_controller.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/window_state.h" 10 #include "ash/wm/window_state.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 located_event_revealed_lock_.reset(); 282 located_event_revealed_lock_.reset();
283 focus_revealed_lock_.reset(); 283 focus_revealed_lock_.reset();
284 284
285 // Try doing the animation. 285 // Try doing the animation.
286 MaybeEndReveal(ANIMATE_SLOW); 286 MaybeEndReveal(ANIMATE_SLOW);
287 287
288 if (reveal_state_ == REVEALED) { 288 if (reveal_state_ == REVEALED) {
289 // Reveal was unsuccessful. Reacquire the revealed locks if appropriate. 289 // Reveal was unsuccessful. Reacquire the revealed locks if appropriate.
290 UpdateLocatedEventRevealedLock(NULL); 290 UpdateLocatedEventRevealedLock(NULL);
291 UpdateFocusRevealedLock(); 291 UpdateFocusRevealedLock();
292 } else {
293 // Clearing focus is important because it closes focus-related popups like
294 // the touch selection handles.
295 widget_->GetFocusManager()->ClearFocus();
292 } 296 }
293 } else { 297 } else {
294 // Stop cursor-at-top tracking. 298 // Stop cursor-at-top tracking.
295 top_edge_hover_timer_.Stop(); 299 top_edge_hover_timer_.Stop();
296 reveal_state_ = CLOSED; 300 reveal_state_ = CLOSED;
297 301
298 delegate_->OnImmersiveFullscreenExited(); 302 delegate_->OnImmersiveFullscreenExited();
299 } 303 }
300 } 304 }
301 305
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 384
381 // Touch gestures should not initiate revealing the top-of-window views while 385 // Touch gestures should not initiate revealing the top-of-window views while
382 // |widget_| is inactive. 386 // |widget_| is inactive.
383 if (!widget_->IsActive()) 387 if (!widget_->IsActive())
384 return; 388 return;
385 389
386 switch (event->type()) { 390 switch (event->type()) {
387 case ui::ET_GESTURE_SCROLL_BEGIN: 391 case ui::ET_GESTURE_SCROLL_BEGIN:
388 if (ShouldHandleGestureEvent(GetEventLocationInScreen(*event))) { 392 if (ShouldHandleGestureEvent(GetEventLocationInScreen(*event))) {
389 gesture_begun_ = true; 393 gesture_begun_ = true;
390 event->SetHandled(); 394 // Do not consume the event. Otherwise, we end up consuming all
395 // ui::ET_GESTURE_SCROLL_BEGIN events in the top-of-window views
396 // when the top-of-window views are revealed.
391 } 397 }
392 break; 398 break;
393 case ui::ET_GESTURE_SCROLL_UPDATE: 399 case ui::ET_GESTURE_SCROLL_UPDATE:
394 if (gesture_begun_) { 400 if (gesture_begun_) {
395 if (UpdateRevealedLocksForSwipe(GetSwipeType(event))) 401 if (UpdateRevealedLocksForSwipe(GetSwipeType(event)))
396 event->SetHandled(); 402 event->SetHandled();
397 gesture_begun_ = false; 403 gesture_begun_ = false;
398 } 404 }
399 break; 405 break;
400 case ui::ET_GESTURE_SCROLL_END: 406 case ui::ET_GESTURE_SCROLL_END:
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 located_event_revealed_lock_.reset(GetRevealedLock(ANIMATE_REVEAL_YES)); 728 located_event_revealed_lock_.reset(GetRevealedLock(ANIMATE_REVEAL_YES));
723 return true; 729 return true;
724 } 730 }
725 } else { 731 } else {
726 if (swipe_type == SWIPE_CLOSE) { 732 if (swipe_type == SWIPE_CLOSE) {
727 // Attempt to end the reveal. If other code is holding onto a lock, the 733 // Attempt to end the reveal. If other code is holding onto a lock, the
728 // attempt will be unsuccessful. 734 // attempt will be unsuccessful.
729 located_event_revealed_lock_.reset(); 735 located_event_revealed_lock_.reset();
730 focus_revealed_lock_.reset(); 736 focus_revealed_lock_.reset();
731 737
732 if (reveal_state_ == SLIDING_CLOSED || reveal_state_ == CLOSED) 738 if (reveal_state_ == SLIDING_CLOSED || reveal_state_ == CLOSED) {
739 widget_->GetFocusManager()->ClearFocus();
733 return true; 740 return true;
741 }
734 742
735 // Ending the reveal was unsuccessful. Reaquire the locks if appropriate. 743 // Ending the reveal was unsuccessful. Reaquire the locks if appropriate.
736 UpdateLocatedEventRevealedLock(NULL); 744 UpdateLocatedEventRevealedLock(NULL);
737 UpdateFocusRevealedLock(); 745 UpdateFocusRevealedLock();
738 } 746 }
739 } 747 }
740 return false; 748 return false;
741 } 749 }
742 750
743 int ImmersiveFullscreenController::GetAnimationDuration(Animate animate) const { 751 int ImmersiveFullscreenController::GetAnimationDuration(Animate animate) const {
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 AsBubbleDelegate(transient_child); 914 AsBubbleDelegate(transient_child);
907 if (bubble_delegate && 915 if (bubble_delegate &&
908 bubble_delegate->GetAnchorView() && 916 bubble_delegate->GetAnchorView() &&
909 top_container_->Contains(bubble_delegate->GetAnchorView())) { 917 top_container_->Contains(bubble_delegate->GetAnchorView())) {
910 bubble_manager_->StartObserving(transient_child); 918 bubble_manager_->StartObserving(transient_child);
911 } 919 }
912 } 920 }
913 } 921 }
914 922
915 } // namespace ash 923 } // namespace ash
OLDNEW
« 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