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

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

Issue 2922233002: [ActiveSuggestionMarker #1] Introduce abstract StyleableMarker subclass of DocumentMarker (Closed)
Patch Set: Add test for IsStyleableMarker() Created 3 years, 6 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/StyleableMarker.h
diff --git a/third_party/WebKit/Source/core/editing/markers/StyleableMarker.h b/third_party/WebKit/Source/core/editing/markers/StyleableMarker.h
new file mode 100644
index 0000000000000000000000000000000000000000..6109234e45f73c7c9b17fd154af95764524f7416
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/StyleableMarker.h
@@ -0,0 +1,47 @@
+// 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 StyleableMarker_h
+#define StyleableMarker_h
+
+#include "core/editing/markers/DocumentMarker.h"
+
+namespace blink {
+
+// An abstract subclass of DocumentMarker to be subclassed by DocumentMarkers
+// that should be renderable with customizable formatting.
+class CORE_EXPORT StyleableMarker : public DocumentMarker {
+ public:
+ enum class Thickness { kThin, kThick };
+
+ StyleableMarker(unsigned start_offset,
+ unsigned end_offset,
+ Color underline_color,
+ Thickness,
+ Color background_color);
+
+ // StyleableMarker-specific
+ Color UnderlineColor() const;
+ bool IsThick() const;
+ Color BackgroundColor() const;
+
+ private:
+ const Color underline_color_;
+ const Color background_color_;
+ const Thickness thickness_;
+
+ DISALLOW_COPY_AND_ASSIGN(StyleableMarker);
+};
+
+bool CORE_EXPORT IsStyleableMarker(const DocumentMarker&);
+
+DEFINE_TYPE_CASTS(StyleableMarker,
+ DocumentMarker,
+ marker,
+ IsStyleableMarker(*marker),
+ IsStyleableMarker(marker));
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698