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

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

Issue 2780313002: [WIP] Refactor DocumentMarker (Closed)
Patch Set: Move accessor methods into derived classes Created 3 years, 9 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/SpellCheckMarker.h
diff --git a/third_party/WebKit/Source/core/editing/markers/SpellCheckMarker.h b/third_party/WebKit/Source/core/editing/markers/SpellCheckMarker.h
new file mode 100644
index 0000000000000000000000000000000000000000..ef5f45a16629e5da65f1b1d8f0a3a53b4675b3b6
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/SpellCheckMarker.h
@@ -0,0 +1,44 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SpellCheckMarker_h
+#define SpellCheckMarker_h
+
+#include "core/editing/markers/DocumentMarker.h"
+
+namespace blink {
+
+class CORE_EXPORT SpellCheckMarker final : public DocumentMarker {
+ public:
+ SpellCheckMarker(DocumentMarker::MarkerType,
+ unsigned startOffset,
+ unsigned endOffset,
+ const String& description);
+
+ // DocumentMarker implementations
+ SpellCheckMarker* clone() const final;
+ MarkerType type() const final;
+
+ // SpellCheckMarker-specific
+ const String& description() const;
+
+ protected:
+ SpellCheckMarker(const SpellCheckMarker&) = default;
+
+ private:
+ DocumentMarker::MarkerType m_type;
+ String m_description;
+};
+
+DEFINE_TYPE_CASTS(SpellCheckMarker,
+ DocumentMarker,
+ marker,
+ marker->type() == DocumentMarker::Spelling ||
+ marker->type() == DocumentMarker::Grammar,
+ marker.type() == DocumentMarker::Spelling ||
+ marker.type() == DocumentMarker::Grammar);
+
+} // namespace blink
+
+#endif // SpellCheckMarker_h

Powered by Google App Engine
This is Rietveld 408576698