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

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

Issue 2919173002: Add DocumentMarker::kActiveSuggestion MarkerType (Closed)
Patch Set: Fix build errors 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/MarkerWithFormatting.h
diff --git a/third_party/WebKit/Source/core/editing/markers/MarkerWithFormatting.h b/third_party/WebKit/Source/core/editing/markers/MarkerWithFormatting.h
new file mode 100644
index 0000000000000000000000000000000000000000..4d8a83a55b908714622204288417e6b998bc6d9c
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/MarkerWithFormatting.h
@@ -0,0 +1,45 @@
+// 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 MarkerWithFormatting_h
+#define MarkerWithFormatting_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 MarkerWithFormatting : public DocumentMarker {
+ public:
+ enum class Thickness { kThin, kThick };
+
+ MarkerWithFormatting(unsigned start_offset,
+ unsigned end_offset,
+ Color underline_color,
+ Thickness,
+ Color background_color);
+
+ // MarkerWithFormatting-specific
+ Color UnderlineColor() const;
+ bool IsThick() const;
+ Color BackgroundColor() const;
+
+ private:
+ const Color underline_color_;
+ const Color background_color_;
+ const Thickness thickness_;
+};
+
+bool CORE_EXPORT IsMarkerWithFormatting(const DocumentMarker&);
+
+DEFINE_TYPE_CASTS(MarkerWithFormatting,
+ DocumentMarker,
+ marker,
+ IsMarkerWithFormatting(*marker),
+ IsMarkerWithFormatting(marker));
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698