diff options
author | shuchen@chromium.org <shuchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-06 13:22:03 +0000 |
---|---|---|
committer | shuchen@chromium.org <shuchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-06 13:22:03 +0000 |
commit | 76f4b039d2dc13e2db8f047aa3a439fbcf940f8c (patch) | |
tree | 2117771e436e2a568c9ebadc621a11b02d292396 /ui/base/ime/input_method_chromeos.h | |
parent | 5d6534dc95e388e23aa3e19f59cf8b052b2a362f (diff) | |
download | chromium_src-76f4b039d2dc13e2db8f047aa3a439fbcf940f8c.zip chromium_src-76f4b039d2dc13e2db8f047aa3a439fbcf940f8c.tar.gz chromium_src-76f4b039d2dc13e2db8f047aa3a439fbcf940f8c.tar.bz2 |
Supports fake key events for setComposition/commitText by on-screen keyboards.
IMF now assumes the IME composing happens with a physical key being pressed.
That assumption is not true for on-screen keyboard scenario.
For on-screen keyboard, when user touch a key button on the screen, the JS
code will call IME API like chrome.input.ime.setComposition(). IMF then should
generate events as:
keydown(229), compositionstart, compositionupdate, input, keyup.
The events compositionstart, compositionupdate and input are generated by
RenderWidgetHostViewAura::SetCompositionText(). So we need to send fake key
events to generate keydown(229) and keyup.
The other part of this change is to make InputMethodEventFilter not depend on
physical key events. Originally, InputMethodEventFilter relies on key events
to find the root window and then get the EventProcessor. It will break
on-screen scenario, because without a physical key being pressed,
target_dispatcher_ will be NULL.
This cl is to let InputMethodEventFilter to always get the EventProcessor from
input_method_->GetTextInputClient()->GetAttachedWindow()->GetRootWindow()...
BUG=376183
TEST=Verified on Pixel device.
Review URL: https://codereview.chromium.org/298893003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275422 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/ime/input_method_chromeos.h')
-rw-r--r-- | ui/base/ime/input_method_chromeos.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/base/ime/input_method_chromeos.h b/ui/base/ime/input_method_chromeos.h index 3c4794b..98b42ae 100644 --- a/ui/base/ime/input_method_chromeos.h +++ b/ui/base/ime/input_method_chromeos.h @@ -88,6 +88,9 @@ class UI_BASE_EXPORT InputMethodChromeOS // Checks if there is pending input method result. bool HasInputMethodResult() const; + // Sends a fake key event for IME composing without physical key events. + void SendFakeProcessKeyEvent(bool pressed) const; + // Abandons all pending key events. It usually happends when we lose keyboard // focus, the text input type is changed or we are destroyed. void AbandonAllPendingKeyEvents(); |