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

Unified Diff: athena/wm/bezel_controller.cc

Issue 574113004: [Athena] Fix switching activities by swiping from the right bezel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@athena_split
Patch Set: Created 6 years, 3 months 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 | athena/wm/public/window_list_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/wm/bezel_controller.cc
diff --git a/athena/wm/bezel_controller.cc b/athena/wm/bezel_controller.cc
index c4a53a04129c1e0ab5f3c1ca4878a5a3d5d34d8a..9ac2a030f494f48cb3c01f875d53d6e8715c423a 100644
--- a/athena/wm/bezel_controller.cc
+++ b/athena/wm/bezel_controller.cc
@@ -83,15 +83,21 @@ void BezelController::SetState(BezelController::State state,
if (!left_right_delegate_ || state == state_)
return;
- if (state == BEZEL_SCROLLING_TWO_FINGERS)
- left_right_delegate_->BezelScrollBegin(scroll_bezel_, scroll_delta);
- else if (state_ == BEZEL_SCROLLING_TWO_FINGERS)
- left_right_delegate_->BezelScrollEnd();
+ State old_state = state_;
state_ = state;
+
if (state == NONE) {
scroll_bezel_ = BEZEL_NONE;
scroll_target_ = NULL;
}
+
+ if (state == BEZEL_SCROLLING_TWO_FINGERS) {
+ left_right_delegate_->BezelScrollBegin(scroll_bezel_, scroll_delta);
+ } else if (old_state == BEZEL_SCROLLING_TWO_FINGERS) {
+ // If BezelScrollEnd() hides |scroll_target_|, ET_GESTURE_END is dispatched
+ // and we get a reentrant call to SetState().
+ left_right_delegate_->BezelScrollEnd();
+ }
}
void BezelController::OnGestureEvent(ui::GestureEvent* event) {
« no previous file with comments | « no previous file | athena/wm/public/window_list_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698