summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/input_method/ibus_ui_controller.cc
diff options
context:
space:
mode:
authoryusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-05 08:25:55 +0000
committeryusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-05 08:25:55 +0000
commitbaf37f9d0785ddcc56b6164fcbac479c904e269f (patch)
tree84913cd3c299e83be6c3258243fe06a331c94d7b /chrome/browser/chromeos/input_method/ibus_ui_controller.cc
parentebe1002c668bb37260e7f362f54b4ced1eb0c4f3 (diff)
downloadchromium_src-baf37f9d0785ddcc56b6164fcbac479c904e269f.zip
chromium_src-baf37f9d0785ddcc56b6164fcbac479c904e269f.tar.gz
chromium_src-baf37f9d0785ddcc56b6164fcbac479c904e269f.tar.bz2
Add "InfoList" for input methods on ChromeOS
BUG=chromium-os:19090 TEST=manually done(Cr-48) Review URL: http://codereview.chromium.org/7791017 Patch from Tsuyoshi Horo <horo@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99625 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/input_method/ibus_ui_controller.cc')
-rw-r--r--chrome/browser/chromeos/input_method/ibus_ui_controller.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/input_method/ibus_ui_controller.cc b/chrome/browser/chromeos/input_method/ibus_ui_controller.cc
index 6d8bb37..f6d1363 100644
--- a/chrome/browser/chromeos/input_method/ibus_ui_controller.cc
+++ b/chrome/browser/chromeos/input_method/ibus_ui_controller.cc
@@ -11,6 +11,7 @@
#include "base/logging.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
+#include "third_party/mozc/session/commands.pb.h"
namespace chromeos {
namespace input_method {
@@ -501,6 +502,29 @@ class IBusUiControllerImpl : public IBusUiController {
lookup_table.orientation = InputMethodLookupTable::kHorizontal;
}
+
+#ifdef OS_CHROMEOS
+ // The function ibus_serializable_get_attachment had been changed
+ // to use GVariant by the commit
+ // https://github.com/ibus/ibus/commit/ac9dfac13cef34288440a2ecdf067cd827fb2f8f
+ GVariant* variant = ibus_serializable_get_attachment(
+ IBUS_SERIALIZABLE(table), "mozc.candidates");
+ if (variant != NULL) {
+ gconstpointer ptr = g_variant_get_data(variant);
+ if (ptr != NULL) {
+ gsize size = g_variant_get_size(variant);
+ GByteArray* bytearray = g_byte_array_sized_new(size);
+ g_byte_array_append(
+ bytearray, reinterpret_cast<const guint8*>(ptr), size);
+ if (!lookup_table.mozc_candidates.ParseFromArray(
+ bytearray->data, bytearray->len)) {
+ lookup_table.mozc_candidates.Clear();
+ }
+ g_byte_array_unref(bytearray);
+ }
+ }
+#endif
+
// Copy candidates and annotations to |lookup_table|.
for (int i = 0; ; i++) {
IBusText *text = ibus_lookup_table_get_candidate(table, i);