OLD | NEW |
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 135 |
136 DocumentMarker::DocumentMarker(MarkerType type, | 136 DocumentMarker::DocumentMarker(MarkerType type, |
137 unsigned startOffset, | 137 unsigned startOffset, |
138 unsigned endOffset, | 138 unsigned endOffset, |
139 const String& description) | 139 const String& description) |
140 : m_type(type), | 140 : m_type(type), |
141 m_startOffset(startOffset), | 141 m_startOffset(startOffset), |
142 m_endOffset(endOffset), | 142 m_endOffset(endOffset), |
143 m_details(description.isEmpty() | 143 m_details(description.isEmpty() |
144 ? nullptr | 144 ? nullptr |
145 : DocumentMarkerDescription::create(description)) {} | 145 : DocumentMarkerDescription::create(description)) { |
| 146 DCHECK(type != DocumentMarker::TextMatch); |
| 147 } |
146 | 148 |
147 DocumentMarker::DocumentMarker(unsigned startOffset, | 149 DocumentMarker::DocumentMarker(unsigned startOffset, |
148 unsigned endOffset, | 150 unsigned endOffset, |
149 bool activeMatch) | 151 bool activeMatch) |
150 : m_type(DocumentMarker::TextMatch), | 152 : m_type(DocumentMarker::TextMatch), |
151 m_startOffset(startOffset), | 153 m_startOffset(startOffset), |
152 m_endOffset(endOffset), | 154 m_endOffset(endOffset), |
153 m_details(DocumentMarkerTextMatch::create(activeMatch)) {} | 155 m_details(DocumentMarkerTextMatch::create(activeMatch)) {} |
154 | 156 |
155 DocumentMarker::DocumentMarker(unsigned startOffset, | 157 DocumentMarker::DocumentMarker(unsigned startOffset, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 toTextCompositionMarkerDetails(m_details.get())) | 260 toTextCompositionMarkerDetails(m_details.get())) |
259 return details->backgroundColor(); | 261 return details->backgroundColor(); |
260 return Color::transparent; | 262 return Color::transparent; |
261 } | 263 } |
262 | 264 |
263 DEFINE_TRACE(DocumentMarker) { | 265 DEFINE_TRACE(DocumentMarker) { |
264 visitor->trace(m_details); | 266 visitor->trace(m_details); |
265 } | 267 } |
266 | 268 |
267 } // namespace blink | 269 } // namespace blink |
OLD | NEW |