Chromium Code Reviews| Index: ui/base/ime/composition_underline.h |
| diff --git a/ui/base/ime/composition_underline.h b/ui/base/ime/composition_underline.h |
| index c8d09d8416336eb0b86ece88b53af062a80efb04..a8c44b66854d534ef673c14fc073f4d8e9c41022 100644 |
| --- a/ui/base/ime/composition_underline.h |
| +++ b/ui/base/ime/composition_underline.h |
| @@ -7,6 +7,7 @@ |
| #include <vector> |
| +#include "base/basictypes.h" |
| #include "third_party/skia/include/core/SkColor.h" |
| namespace ui { |
| @@ -15,34 +16,43 @@ namespace ui { |
| // third_party/WebKit/public/web/WebCompositionUnderline.h |
| struct CompositionUnderline { |
| CompositionUnderline() |
| - : start_offset(0), |
| - end_offset(0), |
| - color(0), |
| - thick(false) {} |
| - |
| - CompositionUnderline(unsigned s, unsigned e, SkColor c, bool t) |
| - : start_offset(s), |
| - end_offset(e), |
| - color(c), |
| - thick(t) {} |
| + : start_offset(0), |
| + end_offset(0), |
| + color(SK_ColorTRANSPARENT), |
| + thick(false), |
| + background_color(SK_ColorTRANSPARENT) {} |
| + |
| + // TODO(huangs): remove this constructor. |
| + CompositionUnderline(uint32 s, uint32 e, SkColor c, bool t) |
|
Seigo Nonaka
2014/06/20 06:39:13
nit: Can we put only background color for composit
huangs
2014/06/20 14:28:25
Filed issue:
http://crbug.com/387032
A more ambit
|
| + : start_offset(s), |
| + end_offset(e), |
| + color(c), |
| + thick(t), |
| + background_color(SK_ColorTRANSPARENT) {} |
| + |
| + CompositionUnderline(uint32 s, uint32 e, SkColor c, bool t, SkColor bc) |
| + : start_offset(s), |
| + end_offset(e), |
| + color(c), |
| + thick(t), |
| + background_color(bc) {} |
| bool operator==(const CompositionUnderline& rhs) const { |
| return (this->start_offset == rhs.start_offset) && |
| - (this->end_offset == rhs.end_offset) && |
| - (this->color == rhs.color) && |
| - (this->thick == rhs.thick); |
| + (this->end_offset == rhs.end_offset) && (this->color == rhs.color) && |
| + (this->thick == rhs.thick) && |
| + (this->background_color == rhs.background_color); |
| } |
| bool operator!=(const CompositionUnderline& rhs) const { |
| return !(*this == rhs); |
| } |
| - // Though use of unsigned is discouraged, we use it here to make sure it's |
| - // identical to blink::WebCompositionUnderline. |
| - unsigned start_offset; |
| - unsigned end_offset; |
| + uint32 start_offset; |
| + uint32 end_offset; |
| SkColor color; |
| bool thick; |
| + SkColor background_color; |
| }; |
| typedef std::vector<CompositionUnderline> CompositionUnderlines; |