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

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

Issue 2723663002: Refactor DocumentMarkerController (Closed)
Patch Set: Rebase 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 public: 134 public:
135 SpellCheckClientMarkers() : MarkerTypes(Spelling | Grammar) {} 135 SpellCheckClientMarkers() : MarkerTypes(Spelling | Grammar) {}
136 }; 136 };
137 137
138 virtual DocumentMarker* clone() const; 138 virtual DocumentMarker* clone() const;
139 139
140 DocumentMarker(MarkerType, 140 DocumentMarker(MarkerType,
141 unsigned startOffset, 141 unsigned startOffset,
142 unsigned endOffset, 142 unsigned endOffset,
143 const String& description); 143 const String& description);
144 DocumentMarker(unsigned startOffset, unsigned endOffset, bool activeMatch);
145 DocumentMarker(unsigned startOffset, 144 DocumentMarker(unsigned startOffset,
146 unsigned endOffset, 145 unsigned endOffset,
147 Color underlineColor, 146 Color underlineColor,
148 bool thick, 147 bool thick,
149 Color backgroundColor); 148 Color backgroundColor);
150 149
151 MarkerType type() const { return m_type; } 150 MarkerType type() const { return m_type; }
152 unsigned startOffset() const { return m_startOffset; } 151 unsigned startOffset() const { return m_startOffset; }
153 unsigned endOffset() const { return m_endOffset; } 152 unsigned endOffset() const { return m_endOffset; }
154 153
(...skipping 19 matching lines...) Expand all
174 // Offset modifications are done by DocumentMarkerController and subclasses of 173 // Offset modifications are done by DocumentMarkerController and subclasses of
175 // DocumentMarkerList. Other classes should not call following setters. 174 // DocumentMarkerList. Other classes should not call following setters.
176 void setStartOffset(unsigned offset) { m_startOffset = offset; } 175 void setStartOffset(unsigned offset) { m_startOffset = offset; }
177 void setEndOffset(unsigned offset) { m_endOffset = offset; } 176 void setEndOffset(unsigned offset) { m_endOffset = offset; }
178 void shiftOffsets(int delta); 177 void shiftOffsets(int delta);
179 178
180 DECLARE_TRACE(); 179 DECLARE_TRACE();
181 180
182 protected: 181 protected:
183 DocumentMarker(const DocumentMarker&); 182 DocumentMarker(const DocumentMarker&);
183 DocumentMarker(unsigned startOffset, unsigned endOffset, bool activeMatch);
184 184
185 private: 185 private:
186 MarkerType m_type; 186 MarkerType m_type;
187 unsigned m_startOffset; 187 unsigned m_startOffset;
188 unsigned m_endOffset; 188 unsigned m_endOffset;
189 Member<DocumentMarkerDetails> m_details; 189 Member<DocumentMarkerDetails> m_details;
190 }; 190 };
191 191
192 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>; 192 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>;
193 193
194 inline DocumentMarkerDetails* DocumentMarker::details() const { 194 inline DocumentMarkerDetails* DocumentMarker::details() const {
195 return m_details.get(); 195 return m_details.get();
196 } 196 }
197 197
198 class DocumentMarkerDetails 198 class DocumentMarkerDetails
199 : public GarbageCollectedFinalized<DocumentMarkerDetails> { 199 : public GarbageCollectedFinalized<DocumentMarkerDetails> {
200 public: 200 public:
201 DocumentMarkerDetails() {} 201 DocumentMarkerDetails() {}
202 virtual ~DocumentMarkerDetails(); 202 virtual ~DocumentMarkerDetails();
203 virtual bool isDescription() const { return false; } 203 virtual bool isDescription() const { return false; }
204 virtual bool isTextMatch() const { return false; } 204 virtual bool isTextMatch() const { return false; }
205 virtual bool isComposition() const { return false; } 205 virtual bool isComposition() const { return false; }
206 206
207 DEFINE_INLINE_VIRTUAL_TRACE() {} 207 DEFINE_INLINE_VIRTUAL_TRACE() {}
208 }; 208 };
209 209
210 } // namespace blink 210 } // namespace blink
211 211
212 #endif // DocumentMarker_h 212 #endif // DocumentMarker_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698