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

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

Issue 2766003002: Add DocumentMarker::createCompositionMarker() (Closed)
Patch Set: Rebase Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 class MisspellingMarkers : public MarkerTypes { 84 class MisspellingMarkers : public MarkerTypes {
85 public: 85 public:
86 MisspellingMarkers() : MarkerTypes(Spelling | Grammar) {} 86 MisspellingMarkers() : MarkerTypes(Spelling | Grammar) {}
87 }; 87 };
88 88
89 class SpellCheckClientMarkers : public MarkerTypes { 89 class SpellCheckClientMarkers : public MarkerTypes {
90 public: 90 public:
91 SpellCheckClientMarkers() : MarkerTypes(Spelling | Grammar) {} 91 SpellCheckClientMarkers() : MarkerTypes(Spelling | Grammar) {}
92 }; 92 };
93 93
94 static DocumentMarker* createCompositionMarker(unsigned startOffset,
95 unsigned endOffset,
96 Color underlineColor,
97 bool thick,
98 Color backgroundColor);
99
94 DocumentMarker(MarkerType, 100 DocumentMarker(MarkerType,
95 unsigned startOffset, 101 unsigned startOffset,
96 unsigned endOffset, 102 unsigned endOffset,
97 const String& description); 103 const String& description);
98 DocumentMarker(unsigned startOffset, unsigned endOffset, bool activeMatch); 104 DocumentMarker(unsigned startOffset, unsigned endOffset, bool activeMatch);
99 DocumentMarker(unsigned startOffset,
100 unsigned endOffset,
101 Color underlineColor,
102 bool thick,
103 Color backgroundColor);
104 105
105 DocumentMarker(const DocumentMarker&); 106 DocumentMarker(const DocumentMarker&);
106 107
107 MarkerType type() const { return m_type; } 108 MarkerType type() const { return m_type; }
108 unsigned startOffset() const { return m_startOffset; } 109 unsigned startOffset() const { return m_startOffset; }
109 unsigned endOffset() const { return m_endOffset; } 110 unsigned endOffset() const { return m_endOffset; }
110 111
111 const String& description() const; 112 const String& description() const;
112 bool activeMatch() const; 113 bool activeMatch() const;
113 Color underlineColor() const; 114 Color underlineColor() const;
(...skipping 24 matching lines...) Expand all
138 bool operator==(const DocumentMarker& o) const { 139 bool operator==(const DocumentMarker& o) const {
139 return type() == o.type() && startOffset() == o.startOffset() && 140 return type() == o.type() && startOffset() == o.startOffset() &&
140 endOffset() == o.endOffset(); 141 endOffset() == o.endOffset();
141 } 142 }
142 143
143 bool operator!=(const DocumentMarker& o) const { return !(*this == o); } 144 bool operator!=(const DocumentMarker& o) const { return !(*this == o); }
144 145
145 DECLARE_TRACE(); 146 DECLARE_TRACE();
146 147
147 private: 148 private:
149 DocumentMarker(MarkerType,
yosin_UTC9 2017/03/22 05:15:49 It seems this change doesn't relate to introduce D
rlanday 2017/03/22 18:25:15 I need this private constructor to implement the c
yosin_UTC9 2017/03/23 06:04:39 Yes, since this new constructor doesn't need for c
150 unsigned startOffset,
151 unsigned endOffset,
152 DocumentMarkerDetails*);
153
148 MarkerType m_type; 154 MarkerType m_type;
149 unsigned m_startOffset; 155 unsigned m_startOffset;
150 unsigned m_endOffset; 156 unsigned m_endOffset;
151 Member<DocumentMarkerDetails> m_details; 157 Member<DocumentMarkerDetails> m_details;
152 }; 158 };
153 159
154 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>; 160 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>;
155 161
156 inline DocumentMarkerDetails* DocumentMarker::details() const { 162 inline DocumentMarkerDetails* DocumentMarker::details() const {
157 return m_details.get(); 163 return m_details.get();
158 } 164 }
159 165
160 class DocumentMarkerDetails 166 class DocumentMarkerDetails
161 : public GarbageCollectedFinalized<DocumentMarkerDetails> { 167 : public GarbageCollectedFinalized<DocumentMarkerDetails> {
162 public: 168 public:
163 DocumentMarkerDetails() {} 169 DocumentMarkerDetails() {}
164 virtual ~DocumentMarkerDetails(); 170 virtual ~DocumentMarkerDetails();
165 virtual bool isDescription() const { return false; } 171 virtual bool isDescription() const { return false; }
166 virtual bool isTextMatch() const { return false; } 172 virtual bool isTextMatch() const { return false; }
167 virtual bool isComposition() const { return false; } 173 virtual bool isComposition() const { return false; }
168 174
169 DEFINE_INLINE_VIRTUAL_TRACE() {} 175 DEFINE_INLINE_VIRTUAL_TRACE() {}
170 }; 176 };
171 177
172 } // namespace blink 178 } // namespace blink
173 179
174 #endif // DocumentMarker_h 180 #endif // DocumentMarker_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698