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

Side by Side Diff: ui/events/blink/input_handler_proxy.cc

Issue 2358323003: Keep expanded if mouse moves off of scrollbar while dragging (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/events/blink/input_handler_proxy.h" 5 #include "ui/events/blink/input_handler_proxy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 366
367 case WebInputEvent::TouchStart: 367 case WebInputEvent::TouchStart:
368 return HandleTouchStart(static_cast<const WebTouchEvent&>(event)); 368 return HandleTouchStart(static_cast<const WebTouchEvent&>(event));
369 369
370 case WebInputEvent::TouchMove: 370 case WebInputEvent::TouchMove:
371 return HandleTouchMove(static_cast<const WebTouchEvent&>(event)); 371 return HandleTouchMove(static_cast<const WebTouchEvent&>(event));
372 372
373 case WebInputEvent::TouchEnd: 373 case WebInputEvent::TouchEnd:
374 return HandleTouchEnd(static_cast<const WebTouchEvent&>(event)); 374 return HandleTouchEnd(static_cast<const WebTouchEvent&>(event));
375 375
376 case WebInputEvent::MouseDown: {
377 // Only for check scrollbar captured
378 const WebMouseEvent& mouse_event =
379 static_cast<const WebMouseEvent&>(event);
380 CHECK(input_handler_);
381 input_handler_->MouseDownAt(gfx::Point(mouse_event.x, mouse_event.y));
382 return DID_NOT_HANDLE;
383 }
384 case WebInputEvent::MouseUp: {
385 // Only for release scrollbar captured
386 CHECK(input_handler_);
387 input_handler_->MouseUp();
388 return DID_NOT_HANDLE;
389 }
376 case WebInputEvent::MouseMove: { 390 case WebInputEvent::MouseMove: {
377 const WebMouseEvent& mouse_event = 391 const WebMouseEvent& mouse_event =
378 static_cast<const WebMouseEvent&>(event); 392 static_cast<const WebMouseEvent&>(event);
379 // TODO(tony): Ignore when mouse buttons are down?
380 // TODO(davemoore): This should never happen, but bug #326635 showed some 393 // TODO(davemoore): This should never happen, but bug #326635 showed some
381 // surprising crashes. 394 // surprising crashes.
382 CHECK(input_handler_); 395 CHECK(input_handler_);
383 input_handler_->MouseMoveAt(gfx::Point(mouse_event.x, mouse_event.y)); 396 input_handler_->MouseMoveAt(gfx::Point(mouse_event.x, mouse_event.y));
384 return DID_NOT_HANDLE; 397 return DID_NOT_HANDLE;
385 } 398 }
386 399
387 default: 400 default:
388 if (WebInputEvent::isKeyboardEventType(event.type)) { 401 if (WebInputEvent::isKeyboardEventType(event.type)) {
389 // Only call |CancelCurrentFling()| if a fling was active, as it will 402 // Only call |CancelCurrentFling()| if a fling was active, as it will
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
1362 // is made asynchronously, to minimize divergence between main thread and 1375 // is made asynchronously, to minimize divergence between main thread and
1363 // impl thread event handling paths. 1376 // impl thread event handling paths.
1364 base::ThreadTaskRunnerHandle::Get()->PostTask( 1377 base::ThreadTaskRunnerHandle::Get()->PostTask(
1365 FROM_HERE, 1378 FROM_HERE,
1366 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, 1379 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult,
1367 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, 1380 scroll_elasticity_controller_->GetWeakPtr(), gesture_event,
1368 scroll_result)); 1381 scroll_result));
1369 } 1382 }
1370 1383
1371 } // namespace ui 1384 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698