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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 backgroundColor); | 122 backgroundColor); |
123 } | 123 } |
124 | 124 |
125 inline TextCompositionMarkerDetails* toTextCompositionMarkerDetails( | 125 inline TextCompositionMarkerDetails* toTextCompositionMarkerDetails( |
126 DocumentMarkerDetails* details) { | 126 DocumentMarkerDetails* details) { |
127 if (details && details->isComposition()) | 127 if (details && details->isComposition()) |
128 return static_cast<TextCompositionMarkerDetails*>(details); | 128 return static_cast<TextCompositionMarkerDetails*>(details); |
129 return nullptr; | 129 return nullptr; |
130 } | 130 } |
131 | 131 |
| 132 DocumentMarker* DocumentMarker::clone() const { |
| 133 return new DocumentMarker(*this); |
| 134 } |
| 135 |
132 DocumentMarker::DocumentMarker(MarkerType type, | 136 DocumentMarker::DocumentMarker(MarkerType type, |
133 unsigned startOffset, | 137 unsigned startOffset, |
134 unsigned endOffset, | 138 unsigned endOffset, |
135 const String& description) | 139 const String& description) |
136 : m_type(type), | 140 : m_type(type), |
137 m_startOffset(startOffset), | 141 m_startOffset(startOffset), |
138 m_endOffset(endOffset), | 142 m_endOffset(endOffset), |
139 m_details(description.isEmpty() | 143 m_details(description.isEmpty() |
140 ? nullptr | 144 ? nullptr |
141 : DocumentMarkerDescription::create(description)) {} | 145 : DocumentMarkerDescription::create(description)) {} |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 toTextCompositionMarkerDetails(m_details.get())) | 259 toTextCompositionMarkerDetails(m_details.get())) |
256 return details->backgroundColor(); | 260 return details->backgroundColor(); |
257 return Color::transparent; | 261 return Color::transparent; |
258 } | 262 } |
259 | 263 |
260 DEFINE_TRACE(DocumentMarker) { | 264 DEFINE_TRACE(DocumentMarker) { |
261 visitor->trace(m_details); | 265 visitor->trace(m_details); |
262 } | 266 } |
263 | 267 |
264 } // namespace blink | 268 } // namespace blink |
OLD | NEW |