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

Issue 1068093002: Refactoring for InputMethodAuraLinux. (Closed)

Created:
5 years, 8 months ago by Shu Chen
Modified:
5 years, 8 months ago
CC:
chromium-reviews, nona+watch_chromium.org, shuchen+watch_chromium.org, penghuang+watch_chromium.org, yusukes+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactoring for InputMethodAuraLinux. This basically brings back the original implementation of InputMethodGtk long time ago, which covered most of cases that haven't been covered by the current implementation (e.g. generate keypress event for the accent/dead keys). Due to limitations of Aura framework, it is hard to get the native window (e.g. XWindow). Therefore, gtk_im_context_set_cursor_position cannot be called at the appropriate time. The current InputMethodAuraLinux implementation workarounds it to leverage the key event, which carries the information about native window, and call set_client_window in DispatchKeyEvent(). The basic scenarios work but some special scenario cannot work. For example, iBus Pinyin IME tries to show the status-bar-UI at the cursor position without typing any keys. This cl keep the current logics for that and won't fix the issue. And this cl removes the keyup of 229 keycode, which is unnecessary. Therefore, for 229 keycode, the IMF will not try to pair the keydown and keyup. This cl adds some tests to avoid future regressions on basic scenarios which consider sync/async modes, ibus hacky behaviors, dead keys, multi-commits, etc. Note that the tests don't cover all possible scenarios as the worldwide IMEs with different IM modules (xim, ibus, etc.). TBR=sky@chromium.org BUG=463491, 474828, 125161, 458179 TEST=Verified on local linux workstation. Committed: https://crrev.com/fad763a26eb994725004358ffdb622f62b744812 Cr-Commit-Position: refs/heads/master@{#325372}

Patch Set 1 #

Patch Set 2 : add more tests. #

Patch Set 3 : fixed compiling failure. #

Total comments: 8

Patch Set 4 : addressed nona's comments. #

Total comments: 37

Patch Set 5 : nits per comments. #

Patch Set 6 : consider to fix crbug.com/125161 #

Patch Set 7 : Removes unexpected 229 keydown for non-IME users. #

Total comments: 16

Patch Set 8 : code-level refactoring and addressed suzhe's comments. #

Patch Set 9 : #

Patch Set 10 : fixed a bug and add tests. #

Total comments: 18

Patch Set 11 : add more tests and support verify event sequence. #

Total comments: 2

Patch Set 12 : Fixed a bug and update test. #

Patch Set 13 : rebased. #

Patch Set 14 : #

Patch Set 15 : fixed interactive_ui_tests failure. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1055 lines, -355 lines) Patch
M chrome/browser/ui/libgtk2ui/gtk2_ui.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/libgtk2ui/gtk2_ui.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h View 1 2 3 4 3 chunks +6 lines, -53 lines 0 comments Download
M chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.cc View 1 2 3 4 5 6 7 6 chunks +32 lines, -107 lines 0 comments Download
D chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2_unittest.cc View 1 2 1 chunk +0 lines, -55 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +1 line, -14 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -7 lines 0 comments Download
M ui/base/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -0 lines 0 comments Download
M ui/base/ime/input_method_auralinux.h View 1 2 3 4 5 6 7 8 3 chunks +36 lines, -29 lines 0 comments Download
M ui/base/ime/input_method_auralinux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +223 lines, -73 lines 0 comments Download
A ui/base/ime/input_method_auralinux_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +722 lines, -0 lines 0 comments Download
M ui/base/ime/linux/fake_input_method_context.h View 1 chunk +3 lines, -2 lines 0 comments Download
M ui/base/ime/linux/fake_input_method_context.cc View 1 chunk +5 lines, -4 lines 0 comments Download
M ui/base/ime/linux/fake_input_method_context_factory.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M ui/base/ime/linux/fake_input_method_context_factory.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M ui/base/ime/linux/linux_input_method_context.h View 1 2 3 1 chunk +8 lines, -5 lines 0 comments Download
M ui/base/ime/linux/linux_input_method_context_factory.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M ui/base/ui_base_tests.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 52 (12 generated)
Shu Chen
Guys, can you please review this cl? Thanks
5 years, 8 months ago (2015-04-08 00:23:01 UTC) #2
Seigo Nonaka
drive-by. mostly nit-pick. Thank you for your cleaning up! https://codereview.chromium.org/1068093002/diff/40001/ui/base/ime/input_method_auralinux.cc File ui/base/ime/input_method_auralinux.cc (right): https://codereview.chromium.org/1068093002/diff/40001/ui/base/ime/input_method_auralinux.cc#newcode66 ui/base/ime/input_method_auralinux.cc:66: ...
5 years, 8 months ago (2015-04-08 07:14:58 UTC) #4
Shu Chen
Thanks for the review, nona! https://codereview.chromium.org/1068093002/diff/40001/ui/base/ime/input_method_auralinux.cc File ui/base/ime/input_method_auralinux.cc (right): https://codereview.chromium.org/1068093002/diff/40001/ui/base/ime/input_method_auralinux.cc#newcode66 ui/base/ime/input_method_auralinux.cc:66: handling_key_event_ = true; On ...
5 years, 8 months ago (2015-04-08 08:24:13 UTC) #5
Seigo Nonaka
https://codereview.chromium.org/1068093002/diff/60001/ui/base/ime/input_method_auralinux.cc File ui/base/ime/input_method_auralinux.cc (right): https://codereview.chromium.org/1068093002/diff/60001/ui/base/ime/input_method_auralinux.cc#newcode117 ui/base/ime/input_method_auralinux.cc:117: case ui::TEXT_INPUT_TYPE_PASSWORD: Probably off the topic but I just ...
5 years, 8 months ago (2015-04-08 17:15:41 UTC) #6
yukawa
Mostly looks good. Can you (or someone) check if this change has positive/no/negative impact on ...
5 years, 8 months ago (2015-04-08 22:26:49 UTC) #7
Shu Chen
https://codereview.chromium.org/1068093002/diff/60001/chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h File chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h (right): https://codereview.chromium.org/1068093002/diff/60001/chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h#newcode29 chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h:29: explicit X11InputMethodContextImplGtk2( On 2015/04/08 22:26:48, yukawa wrote: > nit: ...
5 years, 8 months ago (2015-04-09 01:16:33 UTC) #8
yukawa
Thanks. Looks good to me. I have only limited knowledge/experience of GTK. I want to ...
5 years, 8 months ago (2015-04-09 05:22:55 UTC) #10
Yuki
Does this CL produce 229-down when 'a' key is pressed even when an IME is ...
5 years, 8 months ago (2015-04-09 05:58:52 UTC) #11
Yuki
On 2015/04/09 05:58:52, Yuki wrote: > Does this CL produce 229-down when 'a' key is ...
5 years, 8 months ago (2015-04-09 06:21:55 UTC) #12
Shu Chen
On 2015/04/09 06:21:55, Yuki wrote: > On 2015/04/09 05:58:52, Yuki wrote: > > Does this ...
5 years, 8 months ago (2015-04-09 06:45:45 UTC) #13
Shu Chen
On 2015/04/09 06:45:45, Shu Chen wrote: > On 2015/04/09 06:21:55, Yuki wrote: > > On ...
5 years, 8 months ago (2015-04-09 07:02:42 UTC) #14
Yuki
On 2015/04/09 06:45:45, Shu Chen wrote: > On 2015/04/09 06:21:55, Yuki wrote: > > On ...
5 years, 8 months ago (2015-04-09 07:03:28 UTC) #15
Yuki
On 2015/04/09 07:03:28, Yuki wrote: > On 2015/04/09 06:45:45, Shu Chen wrote: > > On ...
5 years, 8 months ago (2015-04-09 07:17:47 UTC) #16
Shu Chen
On 2015/04/09 07:17:47, Yuki wrote: > On 2015/04/09 07:03:28, Yuki wrote: > > On 2015/04/09 ...
5 years, 8 months ago (2015-04-09 07:22:38 UTC) #17
Shu Chen
Yuki, can you please take another look at the latest patchset #7?
5 years, 8 months ago (2015-04-09 07:43:38 UTC) #18
Yuki
On 2015/04/09 07:43:38, Shu Chen wrote: > Yuki, can you please take another look at ...
5 years, 8 months ago (2015-04-09 07:56:34 UTC) #19
Shu Chen
On 2015/04/09 07:56:34, Yuki wrote: > On 2015/04/09 07:43:38, Shu Chen wrote: > > Yuki, ...
5 years, 8 months ago (2015-04-09 08:36:07 UTC) #20
Yuki
lgtm
5 years, 8 months ago (2015-04-09 08:38:31 UTC) #21
James Su
https://codereview.chromium.org/1068093002/diff/60001/ui/base/ime/input_method_auralinux.cc File ui/base/ime/input_method_auralinux.cc (right): https://codereview.chromium.org/1068093002/diff/60001/ui/base/ime/input_method_auralinux.cc#newcode107 ui/base/ime/input_method_auralinux.cc:107: } add a comment somewhere to clarify that filtered ...
5 years, 8 months ago (2015-04-09 08:40:02 UTC) #22
James Su
https://codereview.chromium.org/1068093002/diff/120001/ui/base/ime/input_method_auralinux_unittest.cc File ui/base/ime/input_method_auralinux_unittest.cc (right): https://codereview.chromium.org/1068093002/diff/120001/ui/base/ime/input_method_auralinux_unittest.cc#newcode23 ui/base/ime/input_method_auralinux_unittest.cc:23: const base::char16 kActionCompositionEnd = L'E'; Cover this case in ...
5 years, 8 months ago (2015-04-09 09:11:40 UTC) #23
Seigo Nonaka
looks good to me, defer to James and Yuki.
5 years, 8 months ago (2015-04-09 17:10:37 UTC) #24
Shu Chen
https://codereview.chromium.org/1068093002/diff/120001/chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.cc File chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.cc (right): https://codereview.chromium.org/1068093002/diff/120001/chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.cc#newcode40 chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.cc:40: gtk_context_ = gtk_im_multicontext_new(); On 2015/04/09 08:40:02, James Su wrote: ...
5 years, 8 months ago (2015-04-10 05:26:52 UTC) #25
James Su
https://codereview.chromium.org/1068093002/diff/180001/ui/base/ime/input_method_auralinux.cc File ui/base/ime/input_method_auralinux.cc (right): https://codereview.chromium.org/1068093002/diff/180001/ui/base/ime/input_method_auralinux.cc#newcode62 ui/base/ime/input_method_auralinux.cc:62: result_text_.clear(); clear composition_ here. https://codereview.chromium.org/1068093002/diff/180001/ui/base/ime/input_method_auralinux.cc#newcode82 ui/base/ime/input_method_auralinux.cc:82: // composition. This ...
5 years, 8 months ago (2015-04-10 09:25:17 UTC) #26
Shu Chen
https://codereview.chromium.org/1068093002/diff/180001/ui/base/ime/input_method_auralinux.cc File ui/base/ime/input_method_auralinux.cc (right): https://codereview.chromium.org/1068093002/diff/180001/ui/base/ime/input_method_auralinux.cc#newcode62 ui/base/ime/input_method_auralinux.cc:62: result_text_.clear(); On 2015/04/10 09:25:16, James Su wrote: > clear ...
5 years, 8 months ago (2015-04-10 16:17:39 UTC) #27
James Su
https://codereview.chromium.org/1068093002/diff/200001/ui/base/ime/input_method_auralinux.cc File ui/base/ime/input_method_auralinux.cc (right): https://codereview.chromium.org/1068093002/diff/200001/ui/base/ime/input_method_auralinux.cc#newcode116 ui/base/ime/input_method_auralinux.cc:116: composition_.Clear(); According to our discussion, we need to keep ...
5 years, 8 months ago (2015-04-12 14:50:33 UTC) #28
Shu Chen
https://codereview.chromium.org/1068093002/diff/200001/ui/base/ime/input_method_auralinux.cc File ui/base/ime/input_method_auralinux.cc (right): https://codereview.chromium.org/1068093002/diff/200001/ui/base/ime/input_method_auralinux.cc#newcode116 ui/base/ime/input_method_auralinux.cc:116: composition_.Clear(); On 2015/04/12 14:50:33, James Su wrote: > According ...
5 years, 8 months ago (2015-04-13 01:48:44 UTC) #29
James Su
On 2015/04/13 01:48:44, Shu Chen wrote: > https://codereview.chromium.org/1068093002/diff/200001/ui/base/ime/input_method_auralinux.cc > File ui/base/ime/input_method_auralinux.cc (right): > > https://codereview.chromium.org/1068093002/diff/200001/ui/base/ime/input_method_auralinux.cc#newcode116 ...
5 years, 8 months ago (2015-04-13 14:38:33 UTC) #30
Shu Chen
sky@, can you please review this cl? The changes under chrome/browser/ui/ need your approval. Thanks, ...
5 years, 8 months ago (2015-04-13 15:12:46 UTC) #31
sky
As the changes are all in chrome/browser/ui/libgtk2ui, erg is a better reviewer. sky->erg
5 years, 8 months ago (2015-04-13 19:41:27 UTC) #33
Elliot Glaysher
lgtm
5 years, 8 months ago (2015-04-13 20:44:06 UTC) #34
Shu Chen
sky@, your approval is needed for some structural changes for: chrome/test/BUILD.gn ui/base/BUILD.gn ui/base/ui_base_tests.gyp Thanks.
5 years, 8 months ago (2015-04-14 00:56:52 UTC) #35
Shu Chen
On 2015/04/14 00:56:52, Shu Chen wrote: > sky@, your approval is needed for some structural ...
5 years, 8 months ago (2015-04-15 04:52:24 UTC) #36
Shu Chen
On 2015/04/14 00:56:52, Shu Chen wrote: > sky@, your approval is needed for some structural ...
5 years, 8 months ago (2015-04-15 04:52:24 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1068093002/240001
5 years, 8 months ago (2015-04-15 04:56:26 UTC) #40
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/46870)
5 years, 8 months ago (2015-04-15 05:52:20 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1068093002/260001
5 years, 8 months ago (2015-04-15 06:11:38 UTC) #45
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/54213)
5 years, 8 months ago (2015-04-15 08:36:59 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1068093002/280001
5 years, 8 months ago (2015-04-16 00:48:51 UTC) #50
commit-bot: I haz the power
Committed patchset #15 (id:280001)
5 years, 8 months ago (2015-04-16 01:43:52 UTC) #51
commit-bot: I haz the power
5 years, 8 months ago (2015-04-16 01:44:51 UTC) #52
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/fad763a26eb994725004358ffdb622f62b744812
Cr-Commit-Position: refs/heads/master@{#325372}

Powered by Google App Engine
This is Rietveld 408576698