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

Issue 1771173002: Implement input.ime.sendKeyEvents API. (Closed)

Created:
4 years, 9 months ago by Azure Wei
Modified:
4 years, 9 months ago
Reviewers:
Shu Chen, Devlin
CC:
chromium-reviews, extensions-reviews_chromium.org, yusukes+watch_chromium.org, tfarina, shuchen+watch_chromium.org, nona+watch_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, James Su, davemoore+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement input.ime.sendKeyEvents API. This cl implements input.ime.senKeyEvents API on Linux & Windows platform. The API calls the method InputMethodEngineBase::SendKeyEvents(), which contains the common code for ChromeOS/NonChromeOS. And the platform-specific codes are written in InputMethodEngine::SendKeyEvent(). On ChromeOS, the key event is dispatched from directly calling EventProcessor::OnEventFromSource(). While, On Linux & Windows, the key event is dispatched through ImeInputContextHandlerInterface::SendKeyEvent(), which will be implemented by InputMethodXxx. This implementation is similar to input.ime.setComposition and input.ime.commitText APIs. Add browser test in c/t/d/e/api_test/input_ime_nonchromeos/*. BUG=517773 TEST=BrowserTest --gtest_filter=InputImeApiTest.* Committed: https://crrev.com/b293444e8dbe567102fb82ab8831b4e7ac23a59a Cr-Commit-Position: refs/heads/master@{#381175}

Patch Set 1 #

Patch Set 2 : Update test. #

Total comments: 2

Patch Set 3 : Addressed Shu's comment and update implementation on Windows. #

Total comments: 3

Patch Set 4 : Dispatch key event with InputContextHandler. #

Patch Set 5 : Added Windows-specific implementation. #

Total comments: 1

Patch Set 6 : #

Patch Set 7 : Fix patch conflict. #

Total comments: 12

Patch Set 8 : Not dispatch key event to extension if it's faked event from extension. #

Patch Set 9 : #

Patch Set 10 : Added DCHECK. #

Patch Set 11 : Updated the json file. #

Total comments: 4

Patch Set 12 : #

Patch Set 13 : Update gyp/gn file. #

Patch Set 14 : Fix test failure. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+205 lines, -123 lines) Patch
M chrome/browser/chromeos/input_method/input_method_engine.h View 1 2 3 4 5 6 7 8 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/chromeos/input_method/input_method_engine.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +12 lines, -44 lines 0 comments Download
M chrome/browser/extensions/api/input_ime/input_ime_api.h View 1 chunk +11 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/input_ime/input_ime_api.cc View 1 2 3 4 5 6 7 2 chunks +38 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h View 1 chunk +0 lines, -12 lines 0 comments Download
M chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc View 2 chunks +0 lines, -38 lines 0 comments Download
M chrome/browser/ui/input_method/input_method_engine.h View 1 2 3 4 5 6 7 8 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/ui/input_method/input_method_engine.cc View 1 2 3 4 5 6 7 8 9 3 chunks +16 lines, -7 lines 0 comments Download
M chrome/browser/ui/input_method/input_method_engine_base.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/input_method/input_method_engine_base.cc View 1 2 3 4 5 6 7 8 2 chunks +34 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/ime/input_ime_apitest_nonchromeos.cc View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/input_ime.json View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/input_ime_nonchromeos/background.js View 1 2 3 4 5 6 7 1 chunk +18 lines, -0 lines 0 comments Download
M ui/base/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -1 line 0 comments Download
M ui/base/ime/chromeos/mock_ime_input_context_handler.h View 1 2 3 8 1 chunk +1 line, -0 lines 0 comments Download
M ui/base/ime/chromeos/mock_ime_input_context_handler.cc View 1 2 3 8 1 chunk +2 lines, -0 lines 0 comments Download
M ui/base/ime/dummy_text_input_client.h View 1 2 3 4 5 6 7 1 chunk +7 lines, -0 lines 0 comments Download
M ui/base/ime/dummy_text_input_client.cc View 1 2 3 4 5 6 7 2 chunks +7 lines, -3 lines 0 comments Download
M ui/base/ime/ime_input_context_handler_interface.h View 1 2 3 2 chunks +4 lines, -0 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 1 chunk +14 lines, -0 lines 0 comments Download
M ui/base/ime/input_method_base.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -0 lines 0 comments Download
M ui/base/ime/input_method_base.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +9 lines, -1 line 0 comments Download
M ui/base/ime/input_method_win.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +9 lines, -8 lines 0 comments Download
M ui/base/ui_base.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 41 (18 generated)
Azure Wei
Shu and Devlin, can you please help review this cl? Thank you!
4 years, 9 months ago (2016-03-08 01:55:14 UTC) #3
Shu Chen
https://codereview.chromium.org/1771173002/diff/20001/chrome/browser/extensions/api/input_ime/input_ime_api.cc File chrome/browser/extensions/api/input_ime/input_ime_api.cc (right): https://codereview.chromium.org/1771173002/diff/20001/chrome/browser/extensions/api/input_ime/input_ime_api.cc#newcode367 chrome/browser/extensions/api/input_ime/input_ime_api.cc:367: engine->SendKeyEvents(params.context_id, key_data_out); Better to expose the errors.
4 years, 9 months ago (2016-03-08 05:59:44 UTC) #5
Azure Wei
https://codereview.chromium.org/1771173002/diff/20001/chrome/browser/extensions/api/input_ime/input_ime_api.cc File chrome/browser/extensions/api/input_ime/input_ime_api.cc (right): https://codereview.chromium.org/1771173002/diff/20001/chrome/browser/extensions/api/input_ime/input_ime_api.cc#newcode367 chrome/browser/extensions/api/input_ime/input_ime_api.cc:367: engine->SendKeyEvents(params.context_id, key_data_out); On 2016/03/08 05:59:44, Shu Chen wrote: > ...
4 years, 9 months ago (2016-03-08 11:42:29 UTC) #6
Shu Chen
lgtm
4 years, 9 months ago (2016-03-08 13:04:31 UTC) #7
Shu Chen
not lgtm. https://codereview.chromium.org/1771173002/diff/40001/chrome/browser/ui/input_method/input_method_engine.cc File chrome/browser/ui/input_method/input_method_engine.cc (right): https://codereview.chromium.org/1771173002/diff/40001/chrome/browser/ui/input_method/input_method_engine.cc#newcode180 chrome/browser/ui/input_method/input_method_engine.cc:180: #if defined(OS_WIN) I think we should NOT ...
4 years, 9 months ago (2016-03-08 14:38:04 UTC) #8
Shu Chen
https://codereview.chromium.org/1771173002/diff/40001/chrome/browser/ui/input_method/input_method_engine.cc File chrome/browser/ui/input_method/input_method_engine.cc (right): https://codereview.chromium.org/1771173002/diff/40001/chrome/browser/ui/input_method/input_method_engine.cc#newcode180 chrome/browser/ui/input_method/input_method_engine.cc:180: #if defined(OS_WIN) On 2016/03/08 14:38:03, Shu Chen wrote: > ...
4 years, 9 months ago (2016-03-09 04:00:24 UTC) #9
Azure Wei
https://codereview.chromium.org/1771173002/diff/40001/chrome/browser/ui/input_method/input_method_engine.cc File chrome/browser/ui/input_method/input_method_engine.cc (right): https://codereview.chromium.org/1771173002/diff/40001/chrome/browser/ui/input_method/input_method_engine.cc#newcode180 chrome/browser/ui/input_method/input_method_engine.cc:180: #if defined(OS_WIN) On 2016/03/09 04:00:24, Shu Chen wrote: > ...
4 years, 9 months ago (2016-03-09 05:01:57 UTC) #11
Shu Chen
lgtm https://codereview.chromium.org/1771173002/diff/80001/ui/base/ime/input_method_win.cc File ui/base/ime/input_method_win.cc (right): https://codereview.chromium.org/1771173002/diff/80001/ui/base/ime/input_method_win.cc#newcode202 ui/base/ime/input_method_win.cc:202: if (char_msgs->empty() && Replaces the condition char_msgs->empty() with ...
4 years, 9 months ago (2016-03-09 05:50:50 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1771173002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1771173002/100001
4 years, 9 months ago (2016-03-09 05:55:02 UTC) #14
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/170753) mac_chromium_gn_rel on ...
4 years, 9 months ago (2016-03-09 05:57:32 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1771173002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1771173002/120001
4 years, 9 months ago (2016-03-09 06:02:28 UTC) #18
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-09 07:36:07 UTC) #20
Devlin
https://codereview.chromium.org/1771173002/diff/120001/chrome/browser/extensions/api/input_ime/input_ime_api.cc File chrome/browser/extensions/api/input_ime/input_ime_api.cc (right): https://codereview.chromium.org/1771173002/diff/120001/chrome/browser/extensions/api/input_ime/input_ime_api.cc#newcode346 chrome/browser/extensions/api/input_ime/input_ime_api.cc:346: SendKeyEvents::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(parent_params); https://codereview.chromium.org/1771173002/diff/120001/chrome/browser/extensions/api/input_ime/input_ime_api.cc#newcode352 chrome/browser/extensions/api/input_ime/input_ime_api.cc:352: for (size_t i = 0; ...
4 years, 9 months ago (2016-03-10 23:21:14 UTC) #21
Azure Wei
https://codereview.chromium.org/1771173002/diff/120001/chrome/browser/extensions/api/input_ime/input_ime_api.cc File chrome/browser/extensions/api/input_ime/input_ime_api.cc (right): https://codereview.chromium.org/1771173002/diff/120001/chrome/browser/extensions/api/input_ime/input_ime_api.cc#newcode346 chrome/browser/extensions/api/input_ime/input_ime_api.cc:346: SendKeyEvents::Params::Create(*args_)); On 2016/03/10 23:21:14, Devlin wrote: > EXTENSION_FUNCTION_VALIDATE(parent_params); Done. ...
4 years, 9 months ago (2016-03-11 07:29:01 UTC) #22
Devlin
extensions lgtm https://codereview.chromium.org/1771173002/diff/200001/chrome/browser/chromeos/input_method/input_method_engine.cc File chrome/browser/chromeos/input_method/input_method_engine.cc (right): https://codereview.chromium.org/1771173002/diff/200001/chrome/browser/chromeos/input_method/input_method_engine.cc#newcode337 chrome/browser/chromeos/input_method/input_method_engine.cc:337: return false; nit: Could we do return ...
4 years, 9 months ago (2016-03-14 22:32:01 UTC) #23
Azure Wei
https://codereview.chromium.org/1771173002/diff/200001/chrome/browser/chromeos/input_method/input_method_engine.cc File chrome/browser/chromeos/input_method/input_method_engine.cc (right): https://codereview.chromium.org/1771173002/diff/200001/chrome/browser/chromeos/input_method/input_method_engine.cc#newcode337 chrome/browser/chromeos/input_method/input_method_engine.cc:337: return false; On 2016/03/14 22:32:01, Devlin wrote: > nit: ...
4 years, 9 months ago (2016-03-15 00:37:25 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1771173002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1771173002/220001
4 years, 9 months ago (2016-03-15 00:37:54 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_dbg_recipe on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm64_dbg_recipe/builds/35674) android_compile_dbg on tryserver.chromium.android (JOB_FAILED, ...
4 years, 9 months ago (2016-03-15 01:12:04 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1771173002/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1771173002/240001
4 years, 9 months ago (2016-03-15 02:09:35 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: cast_shell_linux on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/129969)
4 years, 9 months ago (2016-03-15 02:36:38 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1771173002/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1771173002/260001
4 years, 9 months ago (2016-03-15 03:31:15 UTC) #37
commit-bot: I haz the power
Committed patchset #14 (id:260001)
4 years, 9 months ago (2016-03-15 04:45:09 UTC) #39
commit-bot: I haz the power
4 years, 9 months ago (2016-03-15 04:46:23 UTC) #41
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/b293444e8dbe567102fb82ab8831b4e7ac23a59a
Cr-Commit-Position: refs/heads/master@{#381175}

Powered by Google App Engine
This is Rietveld 408576698