OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chromeos/dbus/ibus/ibus_text.h" | 5 #include "chromeos/dbus/ibus/ibus_text.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chromeos/dbus/ibus/ibus_object.h" | 9 #include "chromeos/dbus/ibus/ibus_object.h" |
10 #include "dbus/message.h" | 10 #include "dbus/message.h" |
11 | 11 |
12 namespace chromeos { | 12 namespace chromeos { |
13 // TODO(nona): Remove ibus namespace after complete libibus removal. | |
14 namespace ibus { | |
15 | 13 |
16 namespace { | 14 namespace { |
17 const uint32 kAttributeUnderline = 1; // Indicates underline attribute. | 15 const uint32 kAttributeUnderline = 1; // Indicates underline attribute. |
18 const uint32 kAttributeSelection = 2; // Indicates background attribute. | 16 const uint32 kAttributeSelection = 2; // Indicates background attribute. |
19 const char kAnnotationKey[] = "annotation"; | 17 const char kAnnotationKey[] = "annotation"; |
20 const char kDescriptionTitleKey[] = "description_title"; | 18 const char kDescriptionTitleKey[] = "description_title"; |
21 const char kDescriptionBodyKey[] = "description_body"; | 19 const char kDescriptionBodyKey[] = "description_body"; |
22 | 20 |
23 struct IBusAttribute { | 21 struct IBusAttribute { |
24 IBusAttribute() : type(0), value(0), start_index(0), end_index(0) {} | 22 IBusAttribute() : type(0), value(0), start_index(0), end_index(0) {} |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 DVLOG(1) << "Chrome does not support background attribute."; | 205 DVLOG(1) << "Chrome does not support background attribute."; |
208 } | 206 } |
209 } | 207 } |
210 | 208 |
211 return true; | 209 return true; |
212 } | 210 } |
213 | 211 |
214 bool CHROMEOS_EXPORT PopStringFromIBusText(dbus::MessageReader* reader, | 212 bool CHROMEOS_EXPORT PopStringFromIBusText(dbus::MessageReader* reader, |
215 std::string* text) { | 213 std::string* text) { |
216 IBusText ibus_text; | 214 IBusText ibus_text; |
217 if(!PopIBusText(reader, &ibus_text)) | 215 if (!PopIBusText(reader, &ibus_text)) |
218 return false; | 216 return false; |
219 *text = ibus_text.text(); | 217 *text = ibus_text.text(); |
220 return true; | 218 return true; |
221 } | 219 } |
222 | 220 |
223 /////////////////////////////////////////////////////////////////////////////// | 221 /////////////////////////////////////////////////////////////////////////////// |
224 // IBusText | 222 // IBusText |
225 IBusText::IBusText() | 223 IBusText::IBusText() |
226 : text_("") { | 224 : text_("") { |
227 } | 225 } |
228 | 226 |
229 IBusText::~IBusText() { | 227 IBusText::~IBusText() { |
230 } | 228 } |
231 | 229 |
232 } // namespace ibus | |
233 } // namespace chromeos | 230 } // namespace chromeos |
OLD | NEW |