| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/input/MouseEventManager.h" | 5 #include "core/input/MouseEventManager.h" |
| 6 | 6 |
| 7 #include "core/clipboard/DataObject.h" | 7 #include "core/clipboard/DataObject.h" |
| 8 #include "core/clipboard/DataTransfer.h" | 8 #include "core/clipboard/DataTransfer.h" |
| 9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
| 10 #include "core/dom/ElementTraversal.h" | 10 #include "core/dom/ElementTraversal.h" |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 // Use WebFocusTypeForward instead of WebFocusTypeMouse here to mean the | 498 // Use WebFocusTypeForward instead of WebFocusTypeMouse here to mean the |
| 499 // focus has slided. | 499 // focus has slided. |
| 500 found->focus(FocusParams(SelectionBehaviorOnFocus::kReset, | 500 found->focus(FocusParams(SelectionBehaviorOnFocus::kReset, |
| 501 kWebFocusTypeForward, nullptr)); | 501 kWebFocusTypeForward, nullptr)); |
| 502 return true; | 502 return true; |
| 503 } | 503 } |
| 504 } | 504 } |
| 505 return false; | 505 return false; |
| 506 } | 506 } |
| 507 | 507 |
| 508 void MouseEventManager::HandleMouseReleaseEventUpdateStates() { |
| 509 ClearDragHeuristicState(); |
| 510 InvalidateClick(); |
| 511 frame_->GetEventHandler().GetSelectionController().SetMouseDownMayStartSelect( |
| 512 false); |
| 513 } |
| 514 |
| 508 void MouseEventManager::HandleMousePressEventUpdateStates( | 515 void MouseEventManager::HandleMousePressEventUpdateStates( |
| 509 const WebMouseEvent& mouse_event) { | 516 const WebMouseEvent& mouse_event) { |
| 510 CancelFakeMouseMoveEvent(); | 517 CancelFakeMouseMoveEvent(); |
| 511 mouse_pressed_ = true; | 518 mouse_pressed_ = true; |
| 512 captures_dragging_ = true; | 519 captures_dragging_ = true; |
| 513 SetLastKnownMousePosition(mouse_event); | 520 SetLastKnownMousePosition(mouse_event); |
| 514 mouse_down_may_start_drag_ = false; | 521 mouse_down_may_start_drag_ = false; |
| 515 mouse_down_may_start_autoscroll_ = false; | 522 mouse_down_may_start_autoscroll_ = false; |
| 516 mouse_down_timestamp_ = | 523 mouse_down_timestamp_ = |
| 517 TimeTicks::FromSeconds(mouse_event.TimeStampSeconds()); | 524 TimeTicks::FromSeconds(mouse_event.TimeStampSeconds()); |
| 518 | 525 |
| 519 if (FrameView* view = frame_->View()) { | 526 if (FrameView* view = frame_->View()) { |
| 520 mouse_down_pos_ = view->RootFrameToContents( | 527 mouse_down_pos_ = view->RootFrameToContents( |
| 521 FlooredIntPoint(mouse_event.PositionInRootFrame())); | 528 FlooredIntPoint(mouse_event.PositionInRootFrame())); |
| 522 } else { | 529 } else { |
| 523 InvalidateClick(); | 530 InvalidateClick(); |
| 524 } | 531 } |
| 532 |
| 533 frame_->GetEventHandler().GetSelectionController().SetMouseDownMayStartSelect( |
| 534 false); |
| 525 } | 535 } |
| 526 | 536 |
| 527 bool MouseEventManager::IsMousePositionUnknown() { | 537 bool MouseEventManager::IsMousePositionUnknown() { |
| 528 return is_mouse_position_unknown_; | 538 return is_mouse_position_unknown_; |
| 529 } | 539 } |
| 530 | 540 |
| 531 IntPoint MouseEventManager::LastKnownMousePosition() { | 541 IntPoint MouseEventManager::LastKnownMousePosition() { |
| 532 return last_known_mouse_position_; | 542 return last_known_mouse_position_; |
| 533 } | 543 } |
| 534 | 544 |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 | 1042 |
| 1033 void MouseEventManager::SetClickCount(int click_count) { | 1043 void MouseEventManager::SetClickCount(int click_count) { |
| 1034 click_count_ = click_count; | 1044 click_count_ = click_count; |
| 1035 } | 1045 } |
| 1036 | 1046 |
| 1037 bool MouseEventManager::MouseDownMayStartDrag() { | 1047 bool MouseEventManager::MouseDownMayStartDrag() { |
| 1038 return mouse_down_may_start_drag_; | 1048 return mouse_down_may_start_drag_; |
| 1039 } | 1049 } |
| 1040 | 1050 |
| 1041 } // namespace blink | 1051 } // namespace blink |
| OLD | NEW |