Commit 4ef16e68 authored by mfomitchev's avatar mfomitchev Committed by Commit Bot

Simpified Gesture Nav: Don't navigate if affordance isn't showing.

If navigation isn't possible when GestureNavSimple::OnOverscrollModeChange is
called, we don't show the affordance. In this case, we shouldn't attempt to
navigate again when GestureNavSimple::OnOverscrollComplete is called (even
if we can).

BUG=NONE

Review-Url: https://codereview.chromium.org/2983893002
Cr-Commit-Position: refs/heads/master@{#488290}
parent 70c3c5ac
......@@ -385,6 +385,9 @@ bool GestureNavSimple::OnOverscrollUpdate(float delta_x, float delta_y) {
}
void GestureNavSimple::OnOverscrollComplete(OverscrollMode overscroll_mode) {
if (!affordance_ || affordance_->IsFinishing())
return;
CompleteGestureAnimation();
NavigationControllerImpl& controller = web_contents_->GetController();
......@@ -417,7 +420,7 @@ void GestureNavSimple::OnOverscrollModeChange(OverscrollMode old_mode,
start_threshold;
aura::Window* window = web_contents_->GetNativeView();
affordance_.reset(new Affordance(this, new_mode, window->bounds()));
affordance_ = base::MakeUnique<Affordance>(this, new_mode, window->bounds());
// Adding the affordance as a child of the content window is not sufficient,
// because it is possible for a new layer to be parented on top of the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment