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

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

Issue 2931443003: Add support for Android spellcheck menu in Chrome/WebViews (Closed)
Patch Set: Use correct base commit Created 3 years, 5 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 19 matching lines...) Expand all
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/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/editing/suggestion/TextSuggestionController.h"
40 #include "core/events/Event.h" 41 #include "core/events/Event.h"
41 #include "core/frame/LocalFrame.h" 42 #include "core/frame/LocalFrame.h"
42 #include "core/frame/LocalFrameView.h" 43 #include "core/frame/LocalFrameView.h"
43 #include "core/frame/Settings.h" 44 #include "core/frame/Settings.h"
44 #include "core/input/EventHandler.h" 45 #include "core/input/EventHandler.h"
45 #include "core/layout/LayoutView.h" 46 #include "core/layout/LayoutView.h"
46 #include "core/layout/api/LayoutViewItem.h" 47 #include "core/layout/api/LayoutViewItem.h"
47 #include "core/page/FocusController.h" 48 #include "core/page/FocusController.h"
48 #include "core/page/Page.h" 49 #include "core/page/Page.h"
49 #include "platform/RuntimeEnabledFeatures.h" 50 #include "platform/RuntimeEnabledFeatures.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 UpdateSelectionForMouseDownDispatchingSelectStart( 273 UpdateSelectionForMouseDownDispatchingSelectStart(
273 inner_node, 274 inner_node,
274 ExpandSelectionToRespectUserSelectAll( 275 ExpandSelectionToRespectUserSelectAll(
275 inner_node, CreateVisibleSelection( 276 inner_node, CreateVisibleSelection(
276 SelectionInFlatTree::Builder() 277 SelectionInFlatTree::Builder()
277 .Collapse(visible_pos.ToPositionWithAffinity()) 278 .Collapse(visible_pos.ToPositionWithAffinity())
278 .Build())), 279 .Build())),
279 kCharacterGranularity, 280 kCharacterGranularity,
280 is_handle_visible ? HandleVisibility::kVisible 281 is_handle_visible ? HandleVisibility::kVisible
281 : HandleVisibility::kNotVisible); 282 : HandleVisibility::kNotVisible);
283
284 if (event.Event().FromTouch()) {
285 frame_->GetTextSuggestionController().HandlePotentialMisspelledWordTap(
rlanday 2017/06/23 23:59:30 I think this should probably be gated to only run
286 visible_pos);
287 }
288
282 return false; 289 return false;
283 } 290 }
284 291
285 static bool TargetPositionIsBeforeDragStartPosition( 292 static bool TargetPositionIsBeforeDragStartPosition(
286 Node* drag_start_node, 293 Node* drag_start_node,
287 const LayoutPoint& drag_start_point, 294 const LayoutPoint& drag_start_point,
288 Node* target, 295 Node* target,
289 const LayoutPoint& hit_test_point) { 296 const LayoutPoint& hit_test_point) {
290 const PositionInFlatTree& target_position = 297 const PositionInFlatTree& target_position =
291 ToPositionInFlatTree(target->GetLayoutObject() 298 ToPositionInFlatTree(target->GetLayoutObject()
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 1195
1189 bool IsExtendingSelection(const MouseEventWithHitTestResults& event) { 1196 bool IsExtendingSelection(const MouseEventWithHitTestResults& event) {
1190 bool is_mouse_down_on_link_or_image = 1197 bool is_mouse_down_on_link_or_image =
1191 event.IsOverLink() || event.GetHitTestResult().GetImage(); 1198 event.IsOverLink() || event.GetHitTestResult().GetImage();
1192 return (event.Event().GetModifiers() & WebInputEvent::Modifiers::kShiftKey) != 1199 return (event.Event().GetModifiers() & WebInputEvent::Modifiers::kShiftKey) !=
1193 0 && 1200 0 &&
1194 !is_mouse_down_on_link_or_image; 1201 !is_mouse_down_on_link_or_image;
1195 } 1202 }
1196 1203
1197 } // namespace blink 1204 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698