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

Issue 1657593007: Implement chrome.input.ime.setComposition/commitText API. (Closed)

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

Description

Implement chrome.input.ime.setComposition and chrome.input.ime.commitText APIs on Linux and Windows platform. This cl makes ui::InputMethodBase inherits from ui::IMEInputContextHandlerInterface, thus we can implement functions CommitText() and UpdateCompositionText() once for Linux and Windows. Make InputImeKeyEventHandledFunction::Run() calls the new added InputMethodBase::KeyEventHandler() in to set |handling_key_event_|, which indicates whether the IME extension is handling key event. And when |handling_key_event_| == true, we should not setComposition and commitText until it's done to run the callback. Add helper function UpdateCommitText() and CommitTextToInputContext() in InputMethodEngineBase, which will be override in chromeos::InputMehtodEngine and input_method::InputMethodEngine to implement the API on different platforms. BUG=517773 TEST=None Committed: https://crrev.com/db5505268890037e5af265049ab64f79c01ef162 Cr-Commit-Position: refs/heads/master@{#376095}

Patch Set 1 #

Patch Set 2 : Add commitText API. #

Patch Set 3 : #

Total comments: 2

Patch Set 4 : Add KeyEventHandled() function in InputMethodEngineBase. #

Patch Set 5 : Checkout InputImeEventRouter. #

Total comments: 6

Patch Set 6 : Addressed Devlin's comments. #

Total comments: 6

Patch Set 7 : Address Shu's comments. #

Patch Set 8 : Sync up to date. #

Patch Set 9 : Fix test error. #

Patch Set 10 : Fix presubmit warning. #

Patch Set 11 : #

Patch Set 12 : Use string16 rather than wstring #

Patch Set 13 : Fix test error. #

Patch Set 14 : Use Xxx::Results::Create(). #

Unified diffs Side-by-side diffs Delta from patch set Stats (+282 lines, -146 lines) Patch
M chrome/browser/chromeos/input_method/input_method_engine.h View 1 2 3 4 5 1 chunk +7 lines, -0 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 1 chunk +24 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/input_ime/input_ime_api.h View 1 2 3 4 5 6 1 chunk +23 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 8 9 10 11 12 13 2 chunks +66 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h View 1 2 chunks +0 lines, -23 lines 0 comments Download
M chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc View 1 2 3 4 5 6 3 chunks +0 lines, -69 lines 0 comments Download
M chrome/browser/ui/input_method/input_method_engine.h View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/ui/input_method/input_method_engine.cc View 1 2 3 4 5 2 chunks +44 lines, -0 lines 0 comments Download
M chrome/browser/ui/input_method/input_method_engine_base.h View 1 2 3 4 5 6 3 chunks +22 lines, -0 lines 0 comments Download
M chrome/browser/ui/input_method/input_method_engine_base.cc View 1 2 3 4 5 6 5 chunks +27 lines, -33 lines 0 comments Download
M chrome/common/extensions/api/input_ime.json View 1 2 chunks +2 lines, -2 lines 0 comments Download
M ui/base/ime/input_method_base.h View 1 2 3 3 chunks +14 lines, -1 line 0 comments Download
M ui/base/ime/input_method_base.cc View 1 2 3 4 chunks +45 lines, -3 lines 0 comments Download
M ui/base/ime/input_method_chromeos.h View 1 2 3 2 chunks +1 line, -7 lines 0 comments Download
M ui/base/ime/input_method_chromeos.cc View 1 2 3 1 chunk +0 lines, -8 lines 0 comments Download

Messages

Total messages: 53 (26 generated)
Azure Wei
Shu and Devlin, can you please review this cl? Thank you!
4 years, 10 months ago (2016-02-03 08:16:48 UTC) #3
Shu Chen
https://codereview.chromium.org/1657593007/diff/40001/ui/base/ime/input_method_base.h File ui/base/ime/input_method_base.h (right): https://codereview.chromium.org/1657593007/diff/40001/ui/base/ime/input_method_base.h#newcode107 ui/base/ime/input_method_base.h:107: bool handling_key_event_; Can this be moved to InputMethodEngineBase?
4 years, 10 months ago (2016-02-03 09:22:29 UTC) #4
Shu Chen
https://codereview.chromium.org/1657593007/diff/40001/ui/base/ime/input_method_base.h File ui/base/ime/input_method_base.h (right): https://codereview.chromium.org/1657593007/diff/40001/ui/base/ime/input_method_base.h#newcode107 ui/base/ime/input_method_base.h:107: bool handling_key_event_; On 2016/02/03 09:22:29, Shu Chen wrote: > ...
4 years, 10 months ago (2016-02-03 10:05:42 UTC) #5
Azure Wei
On 2016/02/03 10:05:42, Shu Chen wrote: > https://codereview.chromium.org/1657593007/diff/40001/ui/base/ime/input_method_base.h > File ui/base/ime/input_method_base.h (right): > > https://codereview.chromium.org/1657593007/diff/40001/ui/base/ime/input_method_base.h#newcode107 ...
4 years, 10 months ago (2016-02-03 10:19:43 UTC) #6
Azure Wei
On 2016/02/03 10:05:42, Shu Chen wrote: > https://codereview.chromium.org/1657593007/diff/40001/ui/base/ime/input_method_base.h > File ui/base/ime/input_method_base.h (right): > > https://codereview.chromium.org/1657593007/diff/40001/ui/base/ime/input_method_base.h#newcode107 ...
4 years, 10 months ago (2016-02-03 12:08:32 UTC) #7
Devlin
https://codereview.chromium.org/1657593007/diff/80001/chrome/browser/chromeos/input_method/input_method_engine.cc File chrome/browser/chromeos/input_method/input_method_engine.cc (right): https://codereview.chromium.org/1657593007/diff/80001/chrome/browser/chromeos/input_method/input_method_engine.cc#newcode59 chrome/browser/chromeos/input_method/input_method_engine.cc:59: size_t GetUtf8StringLength(const char* s) { Is this *really* that ...
4 years, 10 months ago (2016-02-04 00:09:17 UTC) #10
Azure Wei
https://codereview.chromium.org/1657593007/diff/80001/chrome/browser/chromeos/input_method/input_method_engine.cc File chrome/browser/chromeos/input_method/input_method_engine.cc (right): https://codereview.chromium.org/1657593007/diff/80001/chrome/browser/chromeos/input_method/input_method_engine.cc#newcode59 chrome/browser/chromeos/input_method/input_method_engine.cc:59: size_t GetUtf8StringLength(const char* s) { On 2016/02/04 00:09:17, Devlin ...
4 years, 10 months ago (2016-02-04 03:21:19 UTC) #11
Shu Chen
https://codereview.chromium.org/1657593007/diff/100001/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/1657593007/diff/100001/chrome/browser/extensions/api/input_ime/input_ime_api.cc#newcode253 chrome/browser/extensions/api/input_ime/input_ime_api.cc:253: engine->KeyEventHandled(); Please merge the below OnKeyEventHandled() call into this ...
4 years, 10 months ago (2016-02-04 08:00:47 UTC) #12
Azure Wei
https://codereview.chromium.org/1657593007/diff/100001/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/1657593007/diff/100001/chrome/browser/extensions/api/input_ime/input_ime_api.cc#newcode253 chrome/browser/extensions/api/input_ime/input_ime_api.cc:253: engine->KeyEventHandled(); On 2016/02/04 08:00:46, Shu Chen (OOO till Feb ...
4 years, 10 months ago (2016-02-04 11:57:21 UTC) #13
Shu Chen
lgtm
4 years, 10 months ago (2016-02-04 12:54:23 UTC) #14
Devlin
lgtm
4 years, 10 months ago (2016-02-10 18:11:21 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1657593007/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1657593007/140001
4 years, 10 months ago (2016-02-15 01:36:50 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/125217)
4 years, 10 months ago (2016-02-15 02:11:49 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1657593007/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1657593007/160001
4 years, 10 months ago (2016-02-15 05:16:37 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/146045)
4 years, 10 months ago (2016-02-15 05:24:55 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1657593007/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1657593007/180001
4 years, 10 months ago (2016-02-15 05:48:12 UTC) #28
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/166667)
4 years, 10 months ago (2016-02-15 06:50:31 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1657593007/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1657593007/200001
4 years, 10 months ago (2016-02-15 08:13:36 UTC) #33
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/166711)
4 years, 10 months ago (2016-02-15 09:30:05 UTC) #35
Azure Wei
Hi Devlin, I removed the function GetUtf8StringLength() and used std::string(s).length() as you suggested since patch ...
4 years, 10 months ago (2016-02-15 09:42:02 UTC) #36
Devlin
On 2016/02/15 09:42:02, Azure Wei wrote: > Hi Devlin, I removed the function GetUtf8StringLength() and ...
4 years, 10 months ago (2016-02-16 17:47:25 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1657593007/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1657593007/220001
4 years, 10 months ago (2016-02-17 01:28:51 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/167480)
4 years, 10 months ago (2016-02-17 03:28: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/1657593007/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1657593007/240001
4 years, 10 months ago (2016-02-18 02:58:58 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1657593007/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1657593007/260001
4 years, 10 months ago (2016-02-18 03:37:18 UTC) #49
commit-bot: I haz the power
Committed patchset #14 (id:260001)
4 years, 10 months ago (2016-02-18 04:41:16 UTC) #51
commit-bot: I haz the power
4 years, 10 months ago (2016-02-18 04:42:26 UTC) #53
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/db5505268890037e5af265049ab64f79c01ef162
Cr-Commit-Position: refs/heads/master@{#376095}

Powered by Google App Engine
This is Rietveld 408576698