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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef StyleableMarker_h
6 #define StyleableMarker_h
7
8 #include "core/editing/markers/DocumentMarker.h"
9
10 namespace blink {
11
12 // An abstract subclass of DocumentMarker to be subclassed by DocumentMarkers
13 // that should be renderable with customizable formatting.
14 class CORE_EXPORT StyleableMarker : public DocumentMarker {
15 public:
16 enum class Thickness { kThin, kThick };
17
18 StyleableMarker(unsigned start_offset,
19 unsigned end_offset,
20 Color underline_color,
21 Thickness,
22 Color background_color);
23
24 // StyleableMarker-specific
25 Color UnderlineColor() const;
26 bool IsThick() const;
27 Color BackgroundColor() const;
28
29 private:
30 const Color underline_color_;
31 const Color background_color_;
32 const Thickness thickness_;
33
34 DISALLOW_COPY_AND_ASSIGN(StyleableMarker);
35 };
36
37 bool CORE_EXPORT IsStyleableMarker(const DocumentMarker&);
38
39 DEFINE_TYPE_CASTS(StyleableMarker,
40 DocumentMarker,
41 marker,
42 IsStyleableMarker(*marker),
43 IsStyleableMarker(marker));
44
45 } // namespace blink
46
47 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698