OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
6 * Copyright (C) 2015 Google Inc. All rights reserved. | 6 * Copyright (C) 2015 Google Inc. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 17 matching lines...) Expand all Loading... |
28 */ | 28 */ |
29 | 29 |
30 #include "core/editing/SelectionController.h" | 30 #include "core/editing/SelectionController.h" |
31 | 31 |
32 #include "core/HTMLNames.h" | 32 #include "core/HTMLNames.h" |
33 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
34 #include "core/editing/EditingUtilities.h" | 34 #include "core/editing/EditingUtilities.h" |
35 #include "core/editing/Editor.h" | 35 #include "core/editing/Editor.h" |
36 #include "core/editing/FrameSelection.h" | 36 #include "core/editing/FrameSelection.h" |
37 #include "core/editing/RenderedPosition.h" | 37 #include "core/editing/RenderedPosition.h" |
| 38 #include "core/editing/TextSuggestionController.h" |
38 #include "core/editing/iterators/TextIterator.h" | 39 #include "core/editing/iterators/TextIterator.h" |
39 #include "core/editing/markers/DocumentMarkerController.h" | 40 #include "core/editing/markers/DocumentMarkerController.h" |
40 #include "core/events/Event.h" | 41 #include "core/events/Event.h" |
41 #include "core/frame/FrameView.h" | 42 #include "core/frame/FrameView.h" |
42 #include "core/frame/LocalFrame.h" | 43 #include "core/frame/LocalFrame.h" |
43 #include "core/frame/Settings.h" | 44 #include "core/frame/Settings.h" |
44 #include "core/layout/LayoutView.h" | 45 #include "core/layout/LayoutView.h" |
45 #include "core/layout/api/LayoutViewItem.h" | 46 #include "core/layout/api/LayoutViewItem.h" |
| 47 #include "core/page/ChromeClient.h" |
46 #include "core/page/FocusController.h" | 48 #include "core/page/FocusController.h" |
47 #include "core/page/Page.h" | 49 #include "core/page/Page.h" |
48 #include "platform/RuntimeEnabledFeatures.h" | 50 #include "platform/RuntimeEnabledFeatures.h" |
49 #include "wtf/AutoReset.h" | 51 #include "wtf/AutoReset.h" |
50 | 52 |
51 namespace blink { | 53 namespace blink { |
52 SelectionController* SelectionController::create(LocalFrame& frame) { | 54 SelectionController* SelectionController::create(LocalFrame& frame) { |
53 return new SelectionController(frame); | 55 return new SelectionController(frame); |
54 } | 56 } |
55 | 57 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 isHandleVisible = event.event().fromTouch(); | 253 isHandleVisible = event.event().fromTouch(); |
252 } | 254 } |
253 | 255 |
254 updateSelectionForMouseDownDispatchingSelectStart( | 256 updateSelectionForMouseDownDispatchingSelectStart( |
255 innerNode, | 257 innerNode, |
256 expandSelectionToRespectUserSelectAll( | 258 expandSelectionToRespectUserSelectAll( |
257 innerNode, createVisibleSelection( | 259 innerNode, createVisibleSelection( |
258 SelectionInFlatTree::Builder() | 260 SelectionInFlatTree::Builder() |
259 .collapse(visiblePos.toPositionWithAffinity()) | 261 .collapse(visiblePos.toPositionWithAffinity()) |
260 .build())), | 262 .build())), |
261 CharacterGranularity, isHandleVisible ? HandleVisibility::Visible | 263 CharacterGranularity, |
262 : HandleVisibility::NotVisible); | 264 isHandleVisible ? HandleVisibility::Visible |
| 265 : HandleVisibility::NotVisible); |
| 266 |
| 267 m_frame->textSuggestionController().handlePotentialTextSuggestionTap(); |
| 268 |
263 return false; | 269 return false; |
264 } | 270 } |
265 | 271 |
266 static bool targetPositionIsBeforeDragStartPosition( | 272 static bool targetPositionIsBeforeDragStartPosition( |
267 Node* dragStartNode, | 273 Node* dragStartNode, |
268 const LayoutPoint& dragStartPoint, | 274 const LayoutPoint& dragStartPoint, |
269 Node* target, | 275 Node* target, |
270 const LayoutPoint& hitTestPoint) { | 276 const LayoutPoint& hitTestPoint) { |
271 const PositionInFlatTree& targetPosition = toPositionInFlatTree( | 277 const PositionInFlatTree& targetPosition = toPositionInFlatTree( |
272 target->layoutObject()->positionForPoint(hitTestPoint).position()); | 278 target->layoutObject()->positionForPoint(hitTestPoint).position()); |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 | 1104 |
1099 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { | 1105 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { |
1100 bool isMouseDownOnLinkOrImage = | 1106 bool isMouseDownOnLinkOrImage = |
1101 event.isOverLink() || event.hitTestResult().image(); | 1107 event.isOverLink() || event.hitTestResult().image(); |
1102 return (event.event().modifiers() & WebInputEvent::Modifiers::ShiftKey) != | 1108 return (event.event().modifiers() & WebInputEvent::Modifiers::ShiftKey) != |
1103 0 && | 1109 0 && |
1104 !isMouseDownOnLinkOrImage; | 1110 !isMouseDownOnLinkOrImage; |
1105 } | 1111 } |
1106 | 1112 |
1107 } // namespace blink | 1113 } // namespace blink |
OLD | NEW |