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

Side by Side Diff: third_party/WebKit/Source/core/input/MouseEventManager.cpp

Issue 2610023002: Reset DragState::m_dragSrc when mouse move doesn't meet drag threshold. (Closed)
Patch Set: Rebased. Created 3 years, 11 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 | « third_party/WebKit/Source/core/input/EventHandlerTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 .mouseDownMayStartSelect() && 781 .mouseDownMayStartSelect() &&
782 !m_mouseDownMayStartAutoscroll; 782 !m_mouseDownMayStartAutoscroll;
783 } 783 }
784 784
785 // We are starting a text/image/url drag, so the cursor should be an arrow 785 // We are starting a text/image/url drag, so the cursor should be an arrow
786 // FIXME <rdar://7577595>: Custom cursors aren't supported during drag and 786 // FIXME <rdar://7577595>: Custom cursors aren't supported during drag and
787 // drop (default to pointer). 787 // drop (default to pointer).
788 m_frame->view()->setCursor(pointerCursor()); 788 m_frame->view()->setCursor(pointerCursor());
789 789
790 if (initiator == DragInitiator::Mouse && 790 if (initiator == DragInitiator::Mouse &&
791 !dragThresholdExceeded(event.event().position())) 791 !dragThresholdExceeded(event.event().position())) {
792 dragState().m_dragSrc = nullptr;
792 return true; 793 return true;
794 }
793 795
794 // Once we're past the drag threshold, we don't want to treat this gesture as 796 // Once we're past the drag threshold, we don't want to treat this gesture as
795 // a click. 797 // a click.
796 invalidateClick(); 798 invalidateClick();
797 799
798 if (!tryStartDrag(event)) { 800 if (!tryStartDrag(event)) {
799 // Something failed to start the drag, clean up. 801 // Something failed to start the drag, clean up.
800 clearDragDataTransfer(); 802 clearDragDataTransfer();
801 dragState().m_dragSrc = nullptr; 803 dragState().m_dragSrc = nullptr;
802 } 804 }
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 988
987 void MouseEventManager::setClickCount(int clickCount) { 989 void MouseEventManager::setClickCount(int clickCount) {
988 m_clickCount = clickCount; 990 m_clickCount = clickCount;
989 } 991 }
990 992
991 bool MouseEventManager::mouseDownMayStartDrag() { 993 bool MouseEventManager::mouseDownMayStartDrag() {
992 return m_mouseDownMayStartDrag; 994 return m_mouseDownMayStartDrag;
993 } 995 }
994 996
995 } // namespace blink 997 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/EventHandlerTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698