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

Unified Diff: content/browser/web_contents/aura/gesture_nav_simple.cc

Issue 2983893002: Simpified Gesture Nav: Don't navigate if affordance isn't showing. (Closed)
Patch Set: Rebase Created 3 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/aura/gesture_nav_simple.cc
diff --git a/content/browser/web_contents/aura/gesture_nav_simple.cc b/content/browser/web_contents/aura/gesture_nav_simple.cc
index 298103da912f122cbb48d1bc17938c92dab09e04..ef727276f381b452bd1050fb611a6bfc64eac8b8 100644
--- a/content/browser/web_contents/aura/gesture_nav_simple.cc
+++ b/content/browser/web_contents/aura/gesture_nav_simple.cc
@@ -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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698