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

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: Uploading the latest version from my repo so I can reference it 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 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 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
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 <string>
35 #include <vector>
34 #include "../platform/WebColor.h" 36 #include "../platform/WebColor.h"
35 37
36 namespace blink { 38 namespace blink {
37 39
38 // Class WebCompositionUnderline is intended to be used with WebWidget's 40 // Class WebCompositionUnderline is intended to be used with WebWidget's
39 // setComposition() method. 41 // setComposition() method.
40 struct WebCompositionUnderline { 42 struct WebCompositionUnderline {
41 WebCompositionUnderline() 43 WebCompositionUnderline()
42 : startOffset(0), 44 : startOffset(0),
43 endOffset(0), 45 endOffset(0),
44 color(0), 46 color(0),
45 thick(false), 47 thick(false),
46 backgroundColor(0) {} 48 backgroundColor(0) {}
47 49
48 WebCompositionUnderline(unsigned s, 50 WebCompositionUnderline(unsigned s,
49 unsigned e, 51 unsigned e,
50 WebColor c, 52 WebColor c,
51 bool t, 53 bool t,
52 WebColor bc) 54 WebColor bc)
53 : startOffset(s), endOffset(e), color(c), thick(t), backgroundColor(bc) {} 55 : WebCompositionUnderline(s, e, c, t, bc, std::vector<std::string>()) {}
56
57 WebCompositionUnderline(unsigned s,
58 unsigned e,
59 WebColor c,
60 bool t,
61 WebColor bc,
62 std::vector<std::string> su)
63 : startOffset(s),
64 endOffset(e),
65 color(c),
66 thick(t),
67 backgroundColor(bc),
68 suggestions(su) {}
54 69
55 bool operator<(const WebCompositionUnderline& other) const { 70 bool operator<(const WebCompositionUnderline& other) const {
56 return startOffset != other.startOffset ? startOffset < other.startOffset 71 return startOffset != other.startOffset ? startOffset < other.startOffset
57 : endOffset < other.endOffset; 72 : endOffset < other.endOffset;
58 } 73 }
59 74
60 // Need to update IPC_STRUCT_TRAITS_BEGIN(blink::WebCompositionUnderline) 75 // Need to update IPC_STRUCT_TRAITS_BEGIN(blink::WebCompositionUnderline)
61 // if members change. 76 // if members change.
62 unsigned startOffset; 77 unsigned startOffset;
63 unsigned endOffset; 78 unsigned endOffset;
64 WebColor color; 79 WebColor color;
65 bool thick; 80 bool thick;
66 WebColor backgroundColor; 81 WebColor backgroundColor;
82 std::vector<std::string> suggestions;
67 }; 83 };
68 84
69 } // namespace blink 85 } // namespace blink
70 86
71 #endif 87 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/public/platform/input_messages.mojom ('k') | third_party/WebKit/public/web/WebFrameWidget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698