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

Side by Side Diff: third_party/WebKit/Source/core/editing/VisibleSelection.h

Issue 2455083003: Reduce usage of VisibleSelection::setBase() and setExtent() (Closed)
Patch Set: 2016-10-31T10:31:10 Created 4 years, 1 month 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 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004 Apple Computer, 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 TextAffinity affinity() const { return m_affinity; } 68 TextAffinity affinity() const { return m_affinity; }
69 69
70 // TODO(yosin): To make |VisibleSelection| as immutable object, we should 70 // TODO(yosin): To make |VisibleSelection| as immutable object, we should
71 // get rid of |setBase()| and |setExtent()| by replacing them with 71 // get rid of |setBase()| and |setExtent()| by replacing them with
72 // |createVisibleSelection()|. 72 // |createVisibleSelection()|.
73 void setBase(const PositionTemplate<Strategy>&); 73 void setBase(const PositionTemplate<Strategy>&);
74 void setBase(const VisiblePositionTemplate<Strategy>&); 74 void setBase(const VisiblePositionTemplate<Strategy>&);
75 void setExtent(const PositionTemplate<Strategy>&); 75 void setExtent(const PositionTemplate<Strategy>&);
76 void setExtent(const VisiblePositionTemplate<Strategy>&); 76 void setExtent(const VisiblePositionTemplate<Strategy>&);
77 77
78 SelectionTemplate<Strategy> asSelection() const;
78 PositionTemplate<Strategy> base() const { return m_base; } 79 PositionTemplate<Strategy> base() const { return m_base; }
79 PositionTemplate<Strategy> extent() const { return m_extent; } 80 PositionTemplate<Strategy> extent() const { return m_extent; }
80 PositionTemplate<Strategy> start() const { return m_start; } 81 PositionTemplate<Strategy> start() const { return m_start; }
81 PositionTemplate<Strategy> end() const { return m_end; } 82 PositionTemplate<Strategy> end() const { return m_end; }
82 83
83 VisiblePositionTemplate<Strategy> visibleStart() const { 84 VisiblePositionTemplate<Strategy> visibleStart() const {
84 return createVisiblePosition( 85 return createVisiblePosition(
85 m_start, isRange() ? TextAffinity::Downstream : affinity()); 86 m_start, isRange() ? TextAffinity::Downstream : affinity());
86 } 87 }
87 VisiblePositionTemplate<Strategy> visibleEnd() const { 88 VisiblePositionTemplate<Strategy> visibleEnd() const {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 226
226 #ifndef NDEBUG 227 #ifndef NDEBUG
227 // Outside the WebCore namespace for ease of invocation from gdb. 228 // Outside the WebCore namespace for ease of invocation from gdb.
228 void showTree(const blink::VisibleSelection&); 229 void showTree(const blink::VisibleSelection&);
229 void showTree(const blink::VisibleSelection*); 230 void showTree(const blink::VisibleSelection*);
230 void showTree(const blink::VisibleSelectionInFlatTree&); 231 void showTree(const blink::VisibleSelectionInFlatTree&);
231 void showTree(const blink::VisibleSelectionInFlatTree*); 232 void showTree(const blink::VisibleSelectionInFlatTree*);
232 #endif 233 #endif
233 234
234 #endif // VisibleSelection_h 235 #endif // VisibleSelection_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698