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

Side by Side Diff: third_party/WebKit/public/web/WebCompositionUnderline.h

Issue 2650113004: [WIP] Add support for Android SuggestionSpans when editing text (Closed)
Patch Set: Remove logging statements, fix copyright years in new files Created 3 years, 10 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
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebCompositionUnderline_h 31 #ifndef WebCompositionUnderline_h
32 #define WebCompositionUnderline_h 32 #define WebCompositionUnderline_h
33 33
34 #include "../platform/WebColor.h" 34 #include "../platform/WebColor.h"
35 35
36 #include <string>
37 #include <vector>
38
36 namespace blink { 39 namespace blink {
37 40
38 // Class WebCompositionUnderline is intended to be used with WebWidget's 41 // Class WebCompositionUnderline is intended to be used with WebWidget's
39 // setComposition() method. 42 // setComposition() method.
40 struct WebCompositionUnderline { 43 struct WebCompositionUnderline {
41 WebCompositionUnderline() 44 WebCompositionUnderline()
42 : startOffset(0), 45 : startOffset(0),
43 endOffset(0), 46 endOffset(0),
44 color(0), 47 color(0),
45 thick(false), 48 thick(false),
46 backgroundColor(0) {} 49 backgroundColor(0) {}
47 50
48 WebCompositionUnderline(unsigned s, 51 WebCompositionUnderline(unsigned s,
49 unsigned e, 52 unsigned e,
50 WebColor c, 53 WebColor c,
51 bool t, 54 bool t,
52 WebColor bc) 55 WebColor bc)
53 : startOffset(s), endOffset(e), color(c), thick(t), backgroundColor(bc) {} 56 : WebCompositionUnderline(s, e, c, t, bc, std::vector<std::string>()) {}
57
58 WebCompositionUnderline(unsigned s,
59 unsigned e,
60 WebColor c,
61 bool t,
62 WebColor bc,
63 std::vector<std::string> su)
64 : startOffset(s),
65 endOffset(e),
66 color(c),
67 thick(t),
68 backgroundColor(bc),
69 suggestions(su) {}
54 70
55 bool operator<(const WebCompositionUnderline& other) const { 71 bool operator<(const WebCompositionUnderline& other) const {
56 return startOffset != other.startOffset ? startOffset < other.startOffset 72 return startOffset != other.startOffset ? startOffset < other.startOffset
57 : endOffset < other.endOffset; 73 : endOffset < other.endOffset;
58 } 74 }
59 75
60 // Need to update IPC_STRUCT_TRAITS_BEGIN(blink::WebCompositionUnderline) 76 // Need to update IPC_STRUCT_TRAITS_BEGIN(blink::WebCompositionUnderline)
61 // if members change. 77 // if members change.
62 unsigned startOffset; 78 unsigned startOffset;
63 unsigned endOffset; 79 unsigned endOffset;
64 WebColor color; 80 WebColor color;
65 bool thick; 81 bool thick;
66 WebColor backgroundColor; 82 WebColor backgroundColor;
83 std::vector<std::string> suggestions;
67 }; 84 };
68 85
69 } // namespace blink 86 } // namespace blink
70 87
71 #endif 88 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698