| Index: third_party/WebKit/Source/core/editing/markers/DocumentMarker.h
|
| diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h
|
| index 9e58753851247bea874164178a39319b7f5b0f86..d152b37f24a556615246f5521145ceefb319513c 100644
|
| --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h
|
| +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h
|
| @@ -32,14 +32,13 @@
|
|
|
| namespace blink {
|
|
|
| -class DocumentMarkerDetails;
|
| -
|
| // A range of a node within a document that is "marked", such as the range of a
|
| // misspelled word. It optionally includes a description that could be displayed
|
| // in the user interface. It also optionally includes a flag specifying whether
|
| // the match is active, which is ignored for all types other than type
|
| // TextMatch.
|
| -class CORE_EXPORT DocumentMarker : public GarbageCollected<DocumentMarker> {
|
| +class CORE_EXPORT DocumentMarker
|
| + : public GarbageCollectedFinalized<DocumentMarker> {
|
| public:
|
| enum MarkerTypeIndex {
|
| SpellingMarkerIndex = 0,
|
| @@ -135,31 +134,21 @@ class CORE_EXPORT DocumentMarker : public GarbageCollected<DocumentMarker> {
|
| SpellCheckClientMarkers() : MarkerTypes(Spelling | Grammar) {}
|
| };
|
|
|
| - virtual DocumentMarker* clone() const;
|
| + virtual ~DocumentMarker();
|
|
|
| - DocumentMarker(MarkerType,
|
| - unsigned startOffset,
|
| - unsigned endOffset,
|
| - const String& description);
|
| - DocumentMarker(unsigned startOffset,
|
| - unsigned endOffset,
|
| - Color underlineColor,
|
| - bool thick,
|
| - Color backgroundColor);
|
| + virtual DocumentMarker* clone() const = 0;
|
|
|
| - MarkerType type() const { return m_type; }
|
| + virtual MarkerType type() const = 0;
|
| unsigned startOffset() const { return m_startOffset; }
|
| unsigned endOffset() const { return m_endOffset; }
|
|
|
| - const String& description() const;
|
| - bool activeMatch() const;
|
| - Color underlineColor() const;
|
| - bool thick() const;
|
| - Color backgroundColor() const;
|
| - DocumentMarkerDetails* details() const;
|
| -
|
| - void setActiveMatch(bool);
|
| - void clearDetails() { m_details.clear(); }
|
| + // TODO(rlanday): move these accessors into the derived classes (will require
|
| + // adding casts in a bunch of callers)
|
| + virtual const String& description() const;
|
| + virtual bool activeMatch() const;
|
| + virtual Color underlineColor() const;
|
| + virtual bool thick() const;
|
| + virtual Color backgroundColor() const;
|
|
|
| struct MarkerOffsets {
|
| unsigned startOffset;
|
| @@ -176,37 +165,19 @@ class CORE_EXPORT DocumentMarker : public GarbageCollected<DocumentMarker> {
|
| void setEndOffset(unsigned offset) { m_endOffset = offset; }
|
| void shiftOffsets(int delta);
|
|
|
| - DECLARE_TRACE();
|
| + DEFINE_INLINE_VIRTUAL_TRACE() {}
|
|
|
| protected:
|
| DocumentMarker(const DocumentMarker&);
|
| - DocumentMarker(unsigned startOffset, unsigned endOffset, bool activeMatch);
|
| + DocumentMarker(unsigned startOffset, unsigned endOffset);
|
|
|
| private:
|
| - MarkerType m_type;
|
| unsigned m_startOffset;
|
| unsigned m_endOffset;
|
| - Member<DocumentMarkerDetails> m_details;
|
| };
|
|
|
| using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>;
|
|
|
| -inline DocumentMarkerDetails* DocumentMarker::details() const {
|
| - return m_details.get();
|
| -}
|
| -
|
| -class DocumentMarkerDetails
|
| - : public GarbageCollectedFinalized<DocumentMarkerDetails> {
|
| - public:
|
| - DocumentMarkerDetails() {}
|
| - virtual ~DocumentMarkerDetails();
|
| - virtual bool isDescription() const { return false; }
|
| - virtual bool isTextMatch() const { return false; }
|
| - virtual bool isComposition() const { return false; }
|
| -
|
| - DEFINE_INLINE_VIRTUAL_TRACE() {}
|
| -};
|
| -
|
| } // namespace blink
|
|
|
| #endif // DocumentMarker_h
|
|
|