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

Side by Side Diff: content/browser/web_contents/aura/overscroll_window_animation.cc

Issue 1167013002: Fix OverscrollWindowDelegate to not dispatch superfluous OverscrollModeChange events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/web_contents/aura/overscroll_window_delegate.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/browser/web_contents/aura/overscroll_window_animation.h" 5 #include "content/browser/web_contents/aura/overscroll_window_animation.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "content/browser/web_contents/aura/shadow_layer_delegate.h" 10 #include "content/browser/web_contents/aura/shadow_layer_delegate.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 overscroll_cancelled_ = false; 79 overscroll_cancelled_ = false;
80 } else { 80 } else {
81 delegate_->OnOverscrollCompleted(slide_window_.Pass()); 81 delegate_->OnOverscrollCompleted(slide_window_.Pass());
82 } 82 }
83 direction_ = SLIDE_NONE; 83 direction_ = SLIDE_NONE;
84 } 84 }
85 85
86 void OverscrollWindowAnimation::OnOverscrollModeChange( 86 void OverscrollWindowAnimation::OnOverscrollModeChange(
87 OverscrollMode old_mode, 87 OverscrollMode old_mode,
88 OverscrollMode new_mode) { 88 OverscrollMode new_mode) {
89 DCHECK_NE(old_mode, new_mode);
89 Direction new_direction = GetDirectionForMode(new_mode); 90 Direction new_direction = GetDirectionForMode(new_mode);
90 if (new_direction == SLIDE_NONE) { 91 if (new_direction == SLIDE_NONE) {
91 // The user cancelled the in progress animation. 92 // The user cancelled the in progress animation.
92 if (is_active()) 93 if (is_active())
93 CancelSlide(); 94 CancelSlide();
94 return; 95 return;
95 } 96 }
96 if (is_active()) { 97 if (is_active()) {
97 slide_window_->layer()->GetAnimator()->StopAnimating(); 98 slide_window_->layer()->GetAnimator()->StopAnimating();
98 delegate_->GetMainWindow()->layer()->GetAnimator()->StopAnimating(); 99 delegate_->GetMainWindow()->layer()->GetAnimator()->StopAnimating();
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 ui::Layer* OverscrollWindowAnimation::GetBackLayer() const { 168 ui::Layer* OverscrollWindowAnimation::GetBackLayer() const {
168 DCHECK(direction_ != SLIDE_NONE); 169 DCHECK(direction_ != SLIDE_NONE);
169 if (direction_ == SLIDE_BACK) { 170 if (direction_ == SLIDE_BACK) {
170 DCHECK(slide_window_); 171 DCHECK(slide_window_);
171 return slide_window_->layer(); 172 return slide_window_->layer();
172 } 173 }
173 return delegate_->GetMainWindow()->layer(); 174 return delegate_->GetMainWindow()->layer();
174 } 175 }
175 176
176 } // namespace content 177 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/aura/overscroll_window_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698