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

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

Issue 2962473002: Make Position::LastPositionInNode() to take const Node& instead of Node* (Closed)
Patch Set: 2017-06-26T14:00:00 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) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved. 4 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 VisiblePositionTemplate<Strategy> 132 VisiblePositionTemplate<Strategy>
133 VisiblePositionTemplate<Strategy>::InParentBeforeNode(const Node& node) { 133 VisiblePositionTemplate<Strategy>::InParentBeforeNode(const Node& node) {
134 return Create(PositionWithAffinityTemplate<Strategy>( 134 return Create(PositionWithAffinityTemplate<Strategy>(
135 PositionTemplate<Strategy>::InParentBeforeNode(node))); 135 PositionTemplate<Strategy>::InParentBeforeNode(node)));
136 } 136 }
137 137
138 template <typename Strategy> 138 template <typename Strategy>
139 VisiblePositionTemplate<Strategy> 139 VisiblePositionTemplate<Strategy>
140 VisiblePositionTemplate<Strategy>::LastPositionInNode(Node* node) { 140 VisiblePositionTemplate<Strategy>::LastPositionInNode(Node* node) {
141 return Create(PositionWithAffinityTemplate<Strategy>( 141 return Create(PositionWithAffinityTemplate<Strategy>(
142 PositionTemplate<Strategy>::LastPositionInNode(node))); 142 PositionTemplate<Strategy>::LastPositionInNode(*node)));
143 } 143 }
144 144
145 VisiblePosition CreateVisiblePosition(const Position& position, 145 VisiblePosition CreateVisiblePosition(const Position& position,
146 TextAffinity affinity) { 146 TextAffinity affinity) {
147 return VisiblePosition::Create(PositionWithAffinity(position, affinity)); 147 return VisiblePosition::Create(PositionWithAffinity(position, affinity));
148 } 148 }
149 149
150 VisiblePosition CreateVisiblePosition( 150 VisiblePosition CreateVisiblePosition(
151 const PositionWithAffinity& position_with_affinity) { 151 const PositionWithAffinity& position_with_affinity) {
152 return VisiblePosition::Create(position_with_affinity); 152 return VisiblePosition::Create(position_with_affinity);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 return; 211 return;
212 } 212 }
213 DVLOG(0) << "Cannot showTree for (nil) VisiblePosition."; 213 DVLOG(0) << "Cannot showTree for (nil) VisiblePosition.";
214 } 214 }
215 215
216 void showTree(const blink::VisiblePosition& vpos) { 216 void showTree(const blink::VisiblePosition& vpos) {
217 vpos.ShowTreeForThis(); 217 vpos.ShowTreeForThis();
218 } 218 }
219 219
220 #endif 220 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/TextFinder.cpp ('k') | third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698