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

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

Issue 2784753002: Add TextMatchMarkerList in preparation for DocumentMarkerController refactor (Closed)
Patch Set: Remove unnecessary TextMatchMarker constructor Created 3 years, 8 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 * This file is part of the DOM implementation for WebCore. 2 * This file is part of the DOM implementation for WebCore.
3 * 3 *
4 * Copyright (C) 2006 Apple Computer, Inc. 4 * Copyright (C) 2006 Apple Computer, Inc.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 class MisspellingMarkers : public MarkerTypes { 127 class MisspellingMarkers : public MarkerTypes {
128 public: 128 public:
129 MisspellingMarkers() : MarkerTypes(Spelling | Grammar) {} 129 MisspellingMarkers() : MarkerTypes(Spelling | Grammar) {}
130 }; 130 };
131 131
132 class SpellCheckClientMarkers : public MarkerTypes { 132 class SpellCheckClientMarkers : public MarkerTypes {
133 public: 133 public:
134 SpellCheckClientMarkers() : MarkerTypes(Spelling | Grammar) {} 134 SpellCheckClientMarkers() : MarkerTypes(Spelling | Grammar) {}
135 }; 135 };
136 136
137 virtual DocumentMarker* clone() const;
Xiaocheng 2017/03/29 23:20:57 The introduction of clone() seems pretty light wei
138
137 DocumentMarker(MarkerType, 139 DocumentMarker(MarkerType,
138 unsigned startOffset, 140 unsigned startOffset,
139 unsigned endOffset, 141 unsigned endOffset,
140 const String& description); 142 const String& description);
141 DocumentMarker(unsigned startOffset, unsigned endOffset, bool activeMatch); 143 DocumentMarker(unsigned startOffset, unsigned endOffset, bool activeMatch);
142 DocumentMarker(unsigned startOffset, 144 DocumentMarker(unsigned startOffset,
143 unsigned endOffset, 145 unsigned endOffset,
144 Color underlineColor, 146 Color underlineColor,
145 bool thick, 147 bool thick,
146 Color backgroundColor); 148 Color backgroundColor);
147 149
148 DocumentMarker(const DocumentMarker&);
149
150 MarkerType type() const { return m_type; } 150 MarkerType type() const { return m_type; }
151 unsigned startOffset() const { return m_startOffset; } 151 unsigned startOffset() const { return m_startOffset; }
152 unsigned endOffset() const { return m_endOffset; } 152 unsigned endOffset() const { return m_endOffset; }
153 153
154 const String& description() const; 154 const String& description() const;
155 bool activeMatch() const; 155 bool activeMatch() const;
156 Color underlineColor() const; 156 Color underlineColor() const;
157 bool thick() const; 157 bool thick() const;
158 Color backgroundColor() const; 158 Color backgroundColor() const;
159 DocumentMarkerDetails* details() const; 159 DocumentMarkerDetails* details() const;
(...skipping 19 matching lines...) Expand all
179 179
180 bool operator==(const DocumentMarker& o) const { 180 bool operator==(const DocumentMarker& o) const {
181 return type() == o.type() && startOffset() == o.startOffset() && 181 return type() == o.type() && startOffset() == o.startOffset() &&
182 endOffset() == o.endOffset(); 182 endOffset() == o.endOffset();
183 } 183 }
184 184
185 bool operator!=(const DocumentMarker& o) const { return !(*this == o); } 185 bool operator!=(const DocumentMarker& o) const { return !(*this == o); }
186 186
187 DECLARE_TRACE(); 187 DECLARE_TRACE();
188 188
189 protected:
190 DocumentMarker(const DocumentMarker&);
191
189 private: 192 private:
190 MarkerType m_type; 193 MarkerType m_type;
191 unsigned m_startOffset; 194 unsigned m_startOffset;
192 unsigned m_endOffset; 195 unsigned m_endOffset;
193 Member<DocumentMarkerDetails> m_details; 196 Member<DocumentMarkerDetails> m_details;
194 }; 197 };
195 198
196 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>; 199 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>;
197 200
198 inline DocumentMarkerDetails* DocumentMarker::details() const { 201 inline DocumentMarkerDetails* DocumentMarker::details() const {
199 return m_details.get(); 202 return m_details.get();
200 } 203 }
201 204
202 class DocumentMarkerDetails 205 class DocumentMarkerDetails
203 : public GarbageCollectedFinalized<DocumentMarkerDetails> { 206 : public GarbageCollectedFinalized<DocumentMarkerDetails> {
204 public: 207 public:
205 DocumentMarkerDetails() {} 208 DocumentMarkerDetails() {}
206 virtual ~DocumentMarkerDetails(); 209 virtual ~DocumentMarkerDetails();
207 virtual bool isDescription() const { return false; } 210 virtual bool isDescription() const { return false; }
208 virtual bool isTextMatch() const { return false; } 211 virtual bool isTextMatch() const { return false; }
209 virtual bool isComposition() const { return false; } 212 virtual bool isComposition() const { return false; }
210 213
211 DEFINE_INLINE_VIRTUAL_TRACE() {} 214 DEFINE_INLINE_VIRTUAL_TRACE() {}
212 }; 215 };
213 216
214 } // namespace blink 217 } // namespace blink
215 218
216 #endif // DocumentMarker_h 219 #endif // DocumentMarker_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698