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

Side by Side Diff: third_party/WebKit/Source/core/page/TouchAdjustment.cpp

Issue 2833343002: Change SelectionStartEnd() returning values instead of assigning into ref args. (Closed)
Patch Set: rebase 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) 2 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 if (text_layout_object->GetSelectionState() == SelectionNone) 205 if (text_layout_object->GetSelectionState() == SelectionNone)
206 return AppendBasicSubtargetsForNode(node, subtargets); 206 return AppendBasicSubtargetsForNode(node, subtargets);
207 // If selected, make subtargets out of only the selected part of the text. 207 // If selected, make subtargets out of only the selected part of the text.
208 int start_pos, end_pos; 208 int start_pos, end_pos;
209 switch (text_layout_object->GetSelectionState()) { 209 switch (text_layout_object->GetSelectionState()) {
210 case SelectionInside: 210 case SelectionInside:
211 start_pos = 0; 211 start_pos = 0;
212 end_pos = text_layout_object->TextLength(); 212 end_pos = text_layout_object->TextLength();
213 break; 213 break;
214 case SelectionStart: 214 case SelectionStart:
215 text_layout_object->SelectionStartEnd(start_pos, end_pos); 215 std::tie(start_pos, end_pos) = text_layout_object->SelectionStartEnd();
216 end_pos = text_layout_object->TextLength(); 216 end_pos = text_layout_object->TextLength();
217 break; 217 break;
218 case SelectionEnd: 218 case SelectionEnd:
219 text_layout_object->SelectionStartEnd(start_pos, end_pos); 219 std::tie(start_pos, end_pos) = text_layout_object->SelectionStartEnd();
220 start_pos = 0; 220 start_pos = 0;
221 break; 221 break;
222 case SelectionBoth: 222 case SelectionBoth:
223 text_layout_object->SelectionStartEnd(start_pos, end_pos); 223 std::tie(start_pos, end_pos) = text_layout_object->SelectionStartEnd();
224 break; 224 break;
225 default: 225 default:
226 ASSERT_NOT_REACHED(); 226 ASSERT_NOT_REACHED();
227 return; 227 return;
228 } 228 }
229 Vector<FloatQuad> quads; 229 Vector<FloatQuad> quads;
230 text_layout_object->AbsoluteQuadsForRange(quads, start_pos, end_pos); 230 text_layout_object->AbsoluteQuadsForRange(quads, start_pos, end_pos);
231 AppendQuadsToSubtargetList(quads, text_node, subtargets); 231 AppendQuadsToSubtargetList(quads, text_node, subtargets);
232 } 232 }
233 } 233 }
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 const HeapVector<Member<Node>>& nodes) { 564 const HeapVector<Member<Node>>& nodes) {
565 IntPoint target_point; 565 IntPoint target_point;
566 TouchAdjustment::SubtargetGeometryList subtargets; 566 TouchAdjustment::SubtargetGeometryList subtargets;
567 TouchAdjustment::CompileZoomableSubtargets(nodes, subtargets); 567 TouchAdjustment::CompileZoomableSubtargets(nodes, subtargets);
568 return TouchAdjustment::FindNodeWithLowestDistanceMetric( 568 return TouchAdjustment::FindNodeWithLowestDistanceMetric(
569 target_node, target_point, target_area, touch_hotspot, touch_area, 569 target_node, target_point, target_area, touch_hotspot, touch_area,
570 subtargets, TouchAdjustment::ZoomableIntersectionQuotient); 570 subtargets, TouchAdjustment::ZoomableIntersectionQuotient);
571 } 571 }
572 572
573 } // namespace blink 573 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp ('k') | third_party/WebKit/Source/core/paint/PartPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698