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

Unified Diff: third_party/WebKit/Source/core/editing/markers/SpellCheckMarker.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/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..053f7c55248d98241cb09e957769e0e0923f0307
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/SpellCheckMarker.h
@@ -0,0 +1,41 @@
+// 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 {
+
+// A subclass of DocumentMarker used to implement functionality shared between
+// spelling and grammar markers. These two marker types both store a
+// description string that can contain suggested replacements for a misspelling
+// or grammar error.
+class CORE_EXPORT SpellCheckMarker : public DocumentMarker {
+ public:
+ SpellCheckMarker(DocumentMarker::MarkerType,
+ unsigned start_offset,
+ unsigned end_offset,
+ const String& description);
+
+ const String& Description() const { return description_; }
+
+ private:
+ const String description_;
+
+ DISALLOW_COPY_AND_ASSIGN(SpellCheckMarker);
+};
+
+bool CORE_EXPORT IsSpellCheckMarker(const DocumentMarker&);
+
+DEFINE_TYPE_CASTS(SpellCheckMarker,
+ DocumentMarker,
+ marker,
+ IsSpellCheckMarker(*marker),
+ IsSpellCheckMarker(marker));
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698