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

Side by Side Diff: third_party/WebKit/Source/core/editing/SelectionController.cpp

Issue 2650113004: [WIP] Add support for Android SuggestionSpans when editing text (Closed)
Patch Set: Remove logging statements, fix copyright years in new files Created 3 years, 10 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 /* 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 25 matching lines...) Expand all
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/iterators/TextIterator.h" 38 #include "core/editing/iterators/TextIterator.h"
39 #include "core/editing/markers/DocumentMarkerController.h" 39 #include "core/editing/markers/DocumentMarkerController.h"
40 #include "core/events/Event.h" 40 #include "core/events/Event.h"
41 #include "core/frame/FrameView.h" 41 #include "core/frame/FrameView.h"
42 #include "core/frame/LocalFrame.h" 42 #include "core/frame/LocalFrame.h"
43 #include "core/frame/Settings.h" 43 #include "core/frame/Settings.h"
44 #include "core/layout/LayoutView.h" 44 #include "core/layout/LayoutView.h"
45 #include "core/layout/api/LayoutViewItem.h" 45 #include "core/layout/api/LayoutViewItem.h"
46 #include "core/page/ChromeClient.h"
46 #include "core/page/FocusController.h" 47 #include "core/page/FocusController.h"
47 #include "core/page/Page.h" 48 #include "core/page/Page.h"
48 #include "platform/RuntimeEnabledFeatures.h" 49 #include "platform/RuntimeEnabledFeatures.h"
49 #include "wtf/AutoReset.h" 50 #include "wtf/AutoReset.h"
50 51
51 namespace blink { 52 namespace blink {
52 SelectionController* SelectionController::create(LocalFrame& frame) { 53 SelectionController* SelectionController::create(LocalFrame& frame) {
53 return new SelectionController(frame); 54 return new SelectionController(frame);
54 } 55 }
55 56
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 isHandleVisible = event.event().fromTouch(); 252 isHandleVisible = event.event().fromTouch();
252 } 253 }
253 254
254 updateSelectionForMouseDownDispatchingSelectStart( 255 updateSelectionForMouseDownDispatchingSelectStart(
255 innerNode, 256 innerNode,
256 expandSelectionToRespectUserSelectAll( 257 expandSelectionToRespectUserSelectAll(
257 innerNode, createVisibleSelection( 258 innerNode, createVisibleSelection(
258 SelectionInFlatTree::Builder() 259 SelectionInFlatTree::Builder()
259 .collapse(visiblePos.toPositionWithAffinity()) 260 .collapse(visiblePos.toPositionWithAffinity())
260 .build())), 261 .build())),
261 CharacterGranularity, isHandleVisible ? HandleVisibility::Visible 262 CharacterGranularity,
262 : HandleVisibility::NotVisible); 263 isHandleVisible ? HandleVisibility::Visible
264 : HandleVisibility::NotVisible);
265
266 document().page()->chromeClient().handlePotentialTextSuggestionTap();
267
263 return false; 268 return false;
264 } 269 }
265 270
266 static bool targetPositionIsBeforeDragStartPosition( 271 static bool targetPositionIsBeforeDragStartPosition(
267 Node* dragStartNode, 272 Node* dragStartNode,
268 const LayoutPoint& dragStartPoint, 273 const LayoutPoint& dragStartPoint,
269 Node* target, 274 Node* target,
270 const LayoutPoint& hitTestPoint) { 275 const LayoutPoint& hitTestPoint) {
271 const PositionInFlatTree& targetPosition = toPositionInFlatTree( 276 const PositionInFlatTree& targetPosition = toPositionInFlatTree(
272 target->layoutObject()->positionForPoint(hitTestPoint).position()); 277 target->layoutObject()->positionForPoint(hitTestPoint).position());
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 1080
1076 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { 1081 bool isExtendingSelection(const MouseEventWithHitTestResults& event) {
1077 bool isMouseDownOnLinkOrImage = 1082 bool isMouseDownOnLinkOrImage =
1078 event.isOverLink() || event.hitTestResult().image(); 1083 event.isOverLink() || event.hitTestResult().image();
1079 return (event.event().modifiers() & WebInputEvent::Modifiers::ShiftKey) != 1084 return (event.event().modifiers() & WebInputEvent::Modifiers::ShiftKey) !=
1080 0 && 1085 0 &&
1081 !isMouseDownOnLinkOrImage; 1086 !isMouseDownOnLinkOrImage;
1082 } 1087 }
1083 1088
1084 } // namespace blink 1089 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698