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

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

Issue 2905753002: [DMC #17] Make TextMatchMarkers constructible in single step (Closed)
Patch Set: Fix build error Created 3 years, 6 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 public: 129 public:
130 MisspellingMarkers() : MarkerTypes(kSpelling | kGrammar) {} 130 MisspellingMarkers() : MarkerTypes(kSpelling | kGrammar) {}
131 }; 131 };
132 132
133 enum class MatchStatus { kInactive, kActive }; 133 enum class MatchStatus { kInactive, kActive };
134 134
135 DocumentMarker(MarkerType, 135 DocumentMarker(MarkerType,
136 unsigned start_offset, 136 unsigned start_offset,
137 unsigned end_offset, 137 unsigned end_offset,
138 const String& description); 138 const String& description);
139 DocumentMarker(unsigned start_offset, unsigned end_offset, MatchStatus);
140 DocumentMarker(unsigned start_offset, 139 DocumentMarker(unsigned start_offset,
141 unsigned end_offset, 140 unsigned end_offset,
142 Color underline_color, 141 Color underline_color,
143 bool thick, 142 bool thick,
144 Color background_color); 143 Color background_color);
145 144
146 DocumentMarker(const DocumentMarker&); 145 DocumentMarker(const DocumentMarker&);
147 146
148 MarkerType GetType() const { return type_; } 147 MarkerType GetType() const { return type_; }
149 unsigned StartOffset() const { return start_offset_; } 148 unsigned StartOffset() const { return start_offset_; }
(...skipping 19 matching lines...) Expand all
169 unsigned new_length) const; 168 unsigned new_length) const;
170 169
171 // Offset modifications are done by DocumentMarkerController. 170 // Offset modifications are done by DocumentMarkerController.
172 // Other classes should not call following setters. 171 // Other classes should not call following setters.
173 void SetStartOffset(unsigned offset) { start_offset_ = offset; } 172 void SetStartOffset(unsigned offset) { start_offset_ = offset; }
174 void SetEndOffset(unsigned offset) { end_offset_ = offset; } 173 void SetEndOffset(unsigned offset) { end_offset_ = offset; }
175 void ShiftOffsets(int delta); 174 void ShiftOffsets(int delta);
176 175
177 DECLARE_TRACE(); 176 DECLARE_TRACE();
178 177
178 protected:
179 DocumentMarker(unsigned start_offset, unsigned end_offset, MatchStatus);
180
179 private: 181 private:
180 MarkerType type_; 182 MarkerType type_;
181 unsigned start_offset_; 183 unsigned start_offset_;
182 unsigned end_offset_; 184 unsigned end_offset_;
183 Member<DocumentMarkerDetails> details_; 185 Member<DocumentMarkerDetails> details_;
184 }; 186 };
185 187
186 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>; 188 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>;
187 189
188 inline DocumentMarkerDetails* DocumentMarker::Details() const { 190 inline DocumentMarkerDetails* DocumentMarker::Details() const {
189 return details_.Get(); 191 return details_.Get();
190 } 192 }
191 193
192 class DocumentMarkerDetails 194 class DocumentMarkerDetails
193 : public GarbageCollectedFinalized<DocumentMarkerDetails> { 195 : public GarbageCollectedFinalized<DocumentMarkerDetails> {
194 public: 196 public:
195 DocumentMarkerDetails() {} 197 DocumentMarkerDetails() {}
196 virtual ~DocumentMarkerDetails(); 198 virtual ~DocumentMarkerDetails();
197 virtual bool IsDescription() const { return false; } 199 virtual bool IsDescription() const { return false; }
198 virtual bool IsTextMatch() const { return false; } 200 virtual bool IsTextMatch() const { return false; }
199 virtual bool IsComposition() const { return false; } 201 virtual bool IsComposition() const { return false; }
200 202
201 DEFINE_INLINE_VIRTUAL_TRACE() {} 203 DEFINE_INLINE_VIRTUAL_TRACE() {}
202 }; 204 };
203 205
204 } // namespace blink 206 } // namespace blink
205 207
206 #endif // DocumentMarker_h 208 #endif // DocumentMarker_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698