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

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

Issue 2789373003: Rename DocumentMarker::activeMatch() to IsActiveMatch() (Closed)
Patch Set: Remove dependency 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 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 DocumentMarkerDetails* details) { 59 DocumentMarkerDetails* details) {
60 if (details && details->isDescription()) 60 if (details && details->isDescription())
61 return static_cast<DocumentMarkerDescription*>(details); 61 return static_cast<DocumentMarkerDescription*>(details);
62 return 0; 62 return 0;
63 } 63 }
64 64
65 class DocumentMarkerTextMatch final : public DocumentMarkerDetails { 65 class DocumentMarkerTextMatch final : public DocumentMarkerDetails {
66 public: 66 public:
67 static DocumentMarkerTextMatch* create(bool); 67 static DocumentMarkerTextMatch* create(bool);
68 68
69 bool activeMatch() const { return m_match; } 69 bool IsActiveMatch() const { return m_match; }
70
70 bool isTextMatch() const override { return true; } 71 bool isTextMatch() const override { return true; }
71 72
72 private: 73 private:
73 explicit DocumentMarkerTextMatch(bool match) : m_match(match) {} 74 explicit DocumentMarkerTextMatch(bool match) : m_match(match) {}
74 75
75 bool m_match; 76 bool m_match;
76 }; 77 };
77 78
78 DocumentMarkerTextMatch* DocumentMarkerTextMatch::create(bool match) { 79 DocumentMarkerTextMatch* DocumentMarkerTextMatch::create(bool match) {
79 DEFINE_STATIC_LOCAL(DocumentMarkerTextMatch, trueInstance, 80 DEFINE_STATIC_LOCAL(DocumentMarkerTextMatch, trueInstance,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 m_details = DocumentMarkerTextMatch::create(active); 176 m_details = DocumentMarkerTextMatch::create(active);
176 } 177 }
177 178
178 const String& DocumentMarker::description() const { 179 const String& DocumentMarker::description() const {
179 if (DocumentMarkerDescription* details = 180 if (DocumentMarkerDescription* details =
180 toDocumentMarkerDescription(m_details.get())) 181 toDocumentMarkerDescription(m_details.get()))
181 return details->description(); 182 return details->description();
182 return emptyString; 183 return emptyString;
183 } 184 }
184 185
185 bool DocumentMarker::activeMatch() const { 186 bool DocumentMarker::IsActiveMatch() const {
186 if (DocumentMarkerTextMatch* details = 187 if (DocumentMarkerTextMatch* details =
187 toDocumentMarkerTextMatch(m_details.get())) 188 toDocumentMarkerTextMatch(m_details.get()))
188 return details->activeMatch(); 189 return details->IsActiveMatch();
189 return false; 190 return false;
190 } 191 }
191 192
192 Color DocumentMarker::underlineColor() const { 193 Color DocumentMarker::underlineColor() const {
193 if (TextCompositionMarkerDetails* details = 194 if (TextCompositionMarkerDetails* details =
194 toTextCompositionMarkerDetails(m_details.get())) 195 toTextCompositionMarkerDetails(m_details.get()))
195 return details->underlineColor(); 196 return details->underlineColor();
196 return Color::transparent; 197 return Color::transparent;
197 } 198 }
198 199
199 bool DocumentMarker::thick() const { 200 bool DocumentMarker::thick() const {
200 if (TextCompositionMarkerDetails* details = 201 if (TextCompositionMarkerDetails* details =
201 toTextCompositionMarkerDetails(m_details.get())) 202 toTextCompositionMarkerDetails(m_details.get()))
202 return details->thick(); 203 return details->thick();
203 return false; 204 return false;
204 } 205 }
205 206
206 Color DocumentMarker::backgroundColor() const { 207 Color DocumentMarker::backgroundColor() const {
207 if (TextCompositionMarkerDetails* details = 208 if (TextCompositionMarkerDetails* details =
208 toTextCompositionMarkerDetails(m_details.get())) 209 toTextCompositionMarkerDetails(m_details.get()))
209 return details->backgroundColor(); 210 return details->backgroundColor();
210 return Color::transparent; 211 return Color::transparent;
211 } 212 }
212 213
213 DEFINE_TRACE(DocumentMarker) { 214 DEFINE_TRACE(DocumentMarker) {
214 visitor->trace(m_details); 215 visitor->trace(m_details);
215 } 216 }
216 217
217 } // namespace blink 218 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698