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

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

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.cpp
diff --git a/third_party/WebKit/Source/core/editing/markers/StyleableMarker.cpp b/third_party/WebKit/Source/core/editing/markers/StyleableMarker.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3ed789a82a392b8d7558c9536873ce10fac2ddb1
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/StyleableMarker.cpp
@@ -0,0 +1,36 @@
+// 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.
+
+#include "core/editing/markers/StyleableMarker.h"
+
+namespace blink {
+
+StyleableMarker::StyleableMarker(unsigned start_offset,
+ unsigned end_offset,
+ Color underline_color,
+ Thickness thickness,
+ Color background_color)
+ : DocumentMarker(start_offset, end_offset),
+ underline_color_(underline_color),
+ background_color_(background_color),
+ thickness_(thickness) {}
+
+Color StyleableMarker::UnderlineColor() const {
+ return underline_color_;
+}
+
+bool StyleableMarker::IsThick() const {
+ return thickness_ == Thickness::kThick;
+}
+
+Color StyleableMarker::BackgroundColor() const {
+ return background_color_;
+}
+
+bool IsStyleableMarker(const DocumentMarker& marker) {
+ DocumentMarker::MarkerType type = marker.GetType();
+ return type == DocumentMarker::kComposition;
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/editing/markers/StyleableMarker.h ('k') | third_party/WebKit/Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698