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

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: Fix dependency Created 3 years, 6 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 frame_->GetTextSuggestionController().HandlePotentialMisspelledWordTap();
282 return false; 284 return false;
283 } 285 }
284 286
285 static bool TargetPositionIsBeforeDragStartPosition( 287 static bool TargetPositionIsBeforeDragStartPosition(
286 Node* drag_start_node, 288 Node* drag_start_node,
287 const LayoutPoint& drag_start_point, 289 const LayoutPoint& drag_start_point,
288 Node* target, 290 Node* target,
289 const LayoutPoint& hit_test_point) { 291 const LayoutPoint& hit_test_point) {
290 const PositionInFlatTree& target_position = 292 const PositionInFlatTree& target_position =
291 ToPositionInFlatTree(target->GetLayoutObject() 293 ToPositionInFlatTree(target->GetLayoutObject()
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 1190
1189 bool IsExtendingSelection(const MouseEventWithHitTestResults& event) { 1191 bool IsExtendingSelection(const MouseEventWithHitTestResults& event) {
1190 bool is_mouse_down_on_link_or_image = 1192 bool is_mouse_down_on_link_or_image =
1191 event.IsOverLink() || event.GetHitTestResult().GetImage(); 1193 event.IsOverLink() || event.GetHitTestResult().GetImage();
1192 return (event.Event().GetModifiers() & WebInputEvent::Modifiers::kShiftKey) != 1194 return (event.Event().GetModifiers() & WebInputEvent::Modifiers::kShiftKey) !=
1193 0 && 1195 0 &&
1194 !is_mouse_down_on_link_or_image; 1196 !is_mouse_down_on_link_or_image;
1195 } 1197 }
1196 1198
1197 } // namespace blink 1199 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698