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

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

Issue 2908643002: [DMC #23] Add CompositionMarker (subclass of DocumentMarker) (Closed)
Patch Set: Attempt to fix Android build by using EXPECT_FALSE() 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/CompositionMarker.h
diff --git a/third_party/WebKit/Source/core/editing/markers/CompositionMarker.h b/third_party/WebKit/Source/core/editing/markers/CompositionMarker.h
new file mode 100644
index 0000000000000000000000000000000000000000..0b02e62ceec94fee5dbabc4493fe534a8a1138b5
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/CompositionMarker.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 CompositionMarker_h
+#define CompositionMarker_h
+
+#include "core/editing/markers/DocumentMarker.h"
+
+namespace blink {
+
+// A subclass of DocumentMarker used to store information specific to
+// composition markers. We store what color to display the underline (possibly
+// transparent), whether the underline should be thick or not, and what
+// background color should be used under the marked text (also possibly
+// transparent).
+class CORE_EXPORT CompositionMarker final : public DocumentMarker {
+ public:
+ CompositionMarker(unsigned start_offset,
+ unsigned end_offset,
+ Color underline_color,
+ bool thick,
+ Color background_color);
+
+ Color UnderlineColor() const;
+ bool Thick() const;
+ Color BackgroundColor() const;
+
+ private:
+ const Color underline_color_;
+ const Color background_color_;
+ const bool thick_;
+
+ DISALLOW_COPY_AND_ASSIGN(CompositionMarker);
+};
+
+DEFINE_TYPE_CASTS(CompositionMarker,
+ DocumentMarker,
+ marker,
+ marker->GetType() == DocumentMarker::kComposition,
+ marker.GetType() == DocumentMarker::kComposition);
+
+} // namespace blink
+
+#endif
« no previous file with comments | « third_party/WebKit/Source/core/editing/BUILD.gn ('k') | third_party/WebKit/Source/core/editing/markers/CompositionMarker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698