OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/input_method/input_method_engine.h" | 5 #include "chrome/browser/chromeos/input_method/input_method_engine.h" |
6 | 6 |
7 #define XK_MISCELLANY | 7 #define XK_MISCELLANY |
8 #include <X11/keysymdef.h> | 8 #include <X11/keysymdef.h> |
9 #include <X11/X.h> | 9 #include <X11/X.h> |
10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 *error = kErrorNotActive; | 137 *error = kErrorNotActive; |
138 return false; | 138 return false; |
139 } | 139 } |
140 if (context_id != context_id_ || context_id_ == -1) { | 140 if (context_id != context_id_ || context_id_ == -1) { |
141 *error = kErrorWrongContext; | 141 *error = kErrorWrongContext; |
142 return false; | 142 return false; |
143 } | 143 } |
144 | 144 |
145 composition_cursor_ = cursor; | 145 composition_cursor_ = cursor; |
146 composition_text_.reset(new CompositionText()); | 146 composition_text_.reset(new CompositionText()); |
147 composition_text_->set_text(text); | 147 composition_text_->set_text(base::UTF8ToUTF16(text)); |
148 | 148 |
149 composition_text_->set_selection_start(selection_start); | 149 composition_text_->set_selection_start(selection_start); |
150 composition_text_->set_selection_end(selection_end); | 150 composition_text_->set_selection_end(selection_end); |
151 | 151 |
152 // TODO: Add support for displaying selected text in the composition string. | 152 // TODO: Add support for displaying selected text in the composition string. |
153 for (std::vector<SegmentInfo>::const_iterator segment = segments.begin(); | 153 for (std::vector<SegmentInfo>::const_iterator segment = segments.begin(); |
154 segment != segments.end(); ++segment) { | 154 segment != segments.end(); ++segment) { |
155 CompositionText::UnderlineAttribute underline; | 155 CompositionText::UnderlineAttribute underline; |
156 | 156 |
157 switch (segment->style) { | 157 switch (segment->style) { |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 // TODO(nona): Implement it. | 618 // TODO(nona): Implement it. |
619 break; | 619 break; |
620 } | 620 } |
621 } | 621 } |
622 } | 622 } |
623 | 623 |
624 // TODO(nona): Support item.children. | 624 // TODO(nona): Support item.children. |
625 } | 625 } |
626 | 626 |
627 } // namespace chromeos | 627 } // namespace chromeos |
OLD | NEW |