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

Side by Side Diff: cc/input/scrollbar_animation_controller.cc

Issue 2718193002: Prevent handle MouseUp when mouse is capture a scrollbar (Closed)
Patch Set: add captured check in mouse up Created 3 years, 9 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 | cc/trees/layer_tree_host_impl_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/input/scrollbar_animation_controller.h" 5 #include "cc/input/scrollbar_animation_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "cc/trees/layer_tree_impl.h" 10 #include "cc/trees/layer_tree_impl.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 215
216 void ScrollbarAnimationController::DidMouseDown() { 216 void ScrollbarAnimationController::DidMouseDown() {
217 if (!need_thinning_animation_ || ScrollbarsHidden()) 217 if (!need_thinning_animation_ || ScrollbarsHidden())
218 return; 218 return;
219 219
220 vertical_controller_->DidMouseDown(); 220 vertical_controller_->DidMouseDown();
221 horizontal_controller_->DidMouseDown(); 221 horizontal_controller_->DidMouseDown();
222 } 222 }
223 223
224 void ScrollbarAnimationController::DidMouseUp() { 224 void ScrollbarAnimationController::DidMouseUp() {
225 if (!need_thinning_animation_) 225 if (!need_thinning_animation_ || !Captured())
226 return; 226 return;
227 227
228 vertical_controller_->DidMouseUp(); 228 vertical_controller_->DidMouseUp();
229 horizontal_controller_->DidMouseUp(); 229 horizontal_controller_->DidMouseUp();
230 230
231 if (!mouse_is_near_any_scrollbar()) 231 if (!mouse_is_near_any_scrollbar())
232 PostDelayedFadeOut(false); 232 PostDelayedFadeOut(false);
233 } 233 }
234 234
235 void ScrollbarAnimationController::DidMouseLeave() { 235 void ScrollbarAnimationController::DidMouseLeave() {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 bool previouslyVisible = opacity_ > 0.0f; 338 bool previouslyVisible = opacity_ > 0.0f;
339 bool currentlyVisible = opacity > 0.0f; 339 bool currentlyVisible = opacity > 0.0f;
340 340
341 opacity_ = opacity; 341 opacity_ = opacity;
342 342
343 if (previouslyVisible != currentlyVisible) 343 if (previouslyVisible != currentlyVisible)
344 client_->DidChangeScrollbarVisibility(); 344 client_->DidChangeScrollbarVisibility();
345 } 345 }
346 346
347 } // namespace cc 347 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698