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

Side by Side Diff: third_party/WebKit/Source/web/ContextMenuClientImpl.cpp

Issue 2858983003: Prune ComputeVisibleSelectionInDOMTreeDeprecated from ContextMenuClientImpl (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | 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 /* 1 /*
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 return WebURL(); 100 return WebURL();
101 } 101 }
102 102
103 static bool IsWhiteSpaceOrPunctuation(UChar c) { 103 static bool IsWhiteSpaceOrPunctuation(UChar c) {
104 return IsSpaceOrNewline(c) || WTF::Unicode::IsPunct(c); 104 return IsSpaceOrNewline(c) || WTF::Unicode::IsPunct(c);
105 } 105 }
106 106
107 static String SelectMisspellingAsync(LocalFrame* selected_frame, 107 static String SelectMisspellingAsync(LocalFrame* selected_frame,
108 String& description) { 108 String& description) {
109 VisibleSelection selection = 109 VisibleSelection selection =
110 selected_frame->Selection().ComputeVisibleSelectionInDOMTreeDeprecated(); 110 selected_frame->Selection().ComputeVisibleSelectionInDOMTree();
111 if (selection.IsNone()) 111 if (selection.IsNone())
112 return String(); 112 return String();
113 113
114 // Caret and range selections always return valid normalized ranges. 114 // Caret and range selections always return valid normalized ranges.
115 Range* selection_range = CreateRange(selection.ToNormalizedEphemeralRange()); 115 Range* selection_range = CreateRange(selection.ToNormalizedEphemeralRange());
116 DocumentMarkerVector markers = 116 DocumentMarkerVector markers =
117 selected_frame->GetDocument()->Markers().MarkersInRange( 117 selected_frame->GetDocument()->Markers().MarkersInRange(
118 EphemeralRange(selection_range), 118 EphemeralRange(selection_range),
119 DocumentMarker::MisspellingMarkers()); 119 DocumentMarker::MisspellingMarkers());
120 if (markers.size() != 1) 120 if (markers.size() != 1)
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 sub_menu_items.Swap(output_items); 466 sub_menu_items.Swap(output_items);
467 } 467 }
468 468
469 void ContextMenuClientImpl::PopulateCustomMenuItems( 469 void ContextMenuClientImpl::PopulateCustomMenuItems(
470 const ContextMenu* default_menu, 470 const ContextMenu* default_menu,
471 WebContextMenuData* data) { 471 WebContextMenuData* data) {
472 PopulateSubMenuItems(default_menu->Items(), data->custom_items); 472 PopulateSubMenuItems(default_menu->Items(), data->custom_items);
473 } 473 }
474 474
475 } // namespace blink 475 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698