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

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

Issue 2911723002: [DMC #24] Add SpellingMarker and GrammarMarker (subclasses of DocumentMarker) (Closed)
Patch Set: Add IsSpellCheckMarker() tests Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
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 2d7169c8ef9e0b68e9800f4ad8ad448b96f3ead1..0ab8fa70cacfa8eb0be4e25c14c10c2ffe7d4316 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h
@@ -32,12 +32,11 @@
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.
-class CORE_EXPORT DocumentMarker : public GarbageCollected<DocumentMarker> {
+class CORE_EXPORT DocumentMarker
+ : public GarbageCollectedFinalized<DocumentMarker> {
public:
enum MarkerTypeIndex {
kSpellingMarkerIndex = 0,
@@ -128,20 +127,12 @@ class CORE_EXPORT DocumentMarker : public GarbageCollected<DocumentMarker> {
MisspellingMarkers() : MarkerTypes(kSpelling | kGrammar) {}
};
- DocumentMarker(MarkerType,
- unsigned start_offset,
- unsigned end_offset,
- const String& description);
+ virtual ~DocumentMarker();
MarkerType GetType() const { return type_; }
unsigned StartOffset() const { return start_offset_; }
unsigned EndOffset() const { return end_offset_; }
- const String& Description() const;
- DocumentMarkerDetails* Details() const;
-
- void ClearDetails() { details_.Clear(); }
-
struct MarkerOffsets {
unsigned start_offset;
unsigned end_offset;
@@ -157,7 +148,7 @@ class CORE_EXPORT DocumentMarker : public GarbageCollected<DocumentMarker> {
void SetEndOffset(unsigned offset) { end_offset_ = offset; }
void ShiftOffsets(int delta);
- DECLARE_TRACE();
+ DEFINE_INLINE_VIRTUAL_TRACE() {}
protected:
DocumentMarker(MarkerType, unsigned start_offset, unsigned end_offset);
@@ -166,27 +157,12 @@ class CORE_EXPORT DocumentMarker : public GarbageCollected<DocumentMarker> {
const MarkerType type_;
unsigned start_offset_;
unsigned end_offset_;
- Member<DocumentMarkerDetails> details_;
DISALLOW_COPY_AND_ASSIGN(DocumentMarker);
};
using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>;
-inline DocumentMarkerDetails* DocumentMarker::Details() const {
- return details_.Get();
-}
-
-class DocumentMarkerDetails
- : public GarbageCollectedFinalized<DocumentMarkerDetails> {
- public:
- DocumentMarkerDetails() {}
- virtual ~DocumentMarkerDetails();
- virtual bool IsDescription() const { return false; }
-
- DEFINE_INLINE_VIRTUAL_TRACE() {}
-};
-
} // namespace blink
#endif // DocumentMarker_h
« no previous file with comments | « third_party/WebKit/Source/core/editing/BUILD.gn ('k') | third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698