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

Issue 313053007: Passing BackgroundColorSpan and UnderlineSpan from Clank to Blink. (Closed)

Created:
6 years, 6 months ago by huangs
Modified:
6 years, 6 months ago
CC:
chromium-reviews, ben+aura_chromium.org, yusukes+watch_chromium.org, yukishiino+watch_chromium.org, jam, penghuang+watch_chromium.org, sadrul, sievers+watch_chromium.org, jbauman+watch_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, kalyank, piman+watch_chromium.org, danakj+watch_chromium.org, James Su, miu+watch_chromium.org, guohui, bcwhite
Visibility:
Public.

Description

Passing BackgroundColorSpan and UnderlineSpan from Clank to Blink. This CL enables custom color to be specified for IME composition. Its Blink counterpart is https://codereview.chromium.org/313233002/ . Details: - Prerequesite: the Blink change, since we assume WebCore::CompositionUnderline and blink::WebCompositionUnderline have been updated. - Prerequesite CL: https://codereview.chromium.org/319553002/ to allow structures to temporarily mismatch, without triggering compiler assert. - Adding background_color to ui::CompositionUnderline. - To pass data from Android to Native C++, using JNI generator with callback: In C++, ImeAdapterAndroid::SetComposingText() calls Java to iterate over spans, then dispatch BackgroundColorSpan and UnderlineSpan data to C++ code and populate list of blink::WebCompositionUnderline. We'll need to split this CL when we commit. BUG=135900 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=278794

Patch Set 1 #

Patch Set 2 : Sync. #

Total comments: 4

Patch Set 3 : Replacing direct JNI calls with JNI generator, and calling back to Java to dispatch. #

Total comments: 2

Patch Set 4 : Making AppendBackgroundColorSpan() static; handling UnderlineSpan. #

Total comments: 8

Patch Set 5 : Cleanup variables, types, and comments. #

Total comments: 8

Patch Set 6 : Changing early-exit in populateUnderlinesFromSpans() to if{}. #

Total comments: 8

Patch Set 7 : Cleanup; changing unsigned to uint32 in ui::CompositionUnderline. #

Patch Set 8 : Ran git cl format. #

Patch Set 9 : Sync. #

Total comments: 6

Patch Set 10 : Casting check and using color consts. #

Patch Set 11 : Sync. #

Total comments: 4

Patch Set 12 : NIT on Java deps; fixing signed-unsigned int compare for unittest. #

Patch Set 13 : Fix typo: SKColor => SkColor. #

Patch Set 14 : Putting back import java.lang.CharSequence for android_aosp. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+256 lines, -128 lines) Patch
M content/browser/renderer_host/ime_adapter_android.h View 1 2 3 1 chunk +6 lines, -2 lines 0 comments Download
M content/browser/renderer_host/ime_adapter_android.cc View 1 2 3 4 5 6 7 8 9 5 chunks +68 lines, -9 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -4 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -3 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -4 lines 0 comments Download
M content/common/content_param_traits_macros.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java View 3 4 2 chunks +3 lines, -4 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java View 1 2 3 4 5 6 7 8 9 10 12 13 6 chunks +39 lines, -8 lines 0 comments Download
M ui/aura/remote_window_tree_host_win.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M ui/base/ime/composition_text_util_pango.cc View 1 2 3 4 5 6 7 2 chunks +7 lines, -4 lines 0 comments Download
M ui/base/ime/composition_text_util_pango_unittest.cc View 1 2 3 4 5 6 7 3 chunks +55 lines, -58 lines 0 comments Download
M ui/base/ime/composition_underline.h View 1 2 3 4 5 6 7 8 9 2 chunks +27 lines, -17 lines 0 comments Download
M ui/base/ime/input_method_chromeos.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +11 lines, -7 lines 0 comments Download
M ui/base/ime/input_method_chromeos_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +10 lines, -0 lines 0 comments Download
M ui/base/ime/win/imm32_manager.cc View 1 2 3 4 5 6 2 chunks +10 lines, -8 lines 0 comments Download

Messages

Total messages: 34 (0 generated)
huangs
PTAL, noting the Blink counterpart https://codereview.chromium.org/313233002/ .
6 years, 6 months ago (2014-06-04 22:30:54 UTC) #1
huangs
Ping.
6 years, 6 months ago (2014-06-06 15:49:49 UTC) #2
yosin_UTC9
Rubber stump ACK I'm not familiar with files in here. But, it seems OK. Please ...
6 years, 6 months ago (2014-06-09 01:34:37 UTC) #3
aurimas (slooooooooow)
https://chromiumcodereview.appspot.com/313053007/diff/20001/content/browser/renderer_host/ime_adapter_android.cc File content/browser/renderer_host/ime_adapter_android.cc (right): https://chromiumcodereview.appspot.com/313053007/diff/20001/content/browser/renderer_host/ime_adapter_android.cc#newcode72 content/browser/renderer_host/ime_adapter_android.cc:72: jclass clsSpannableString = env->FindClass("android/text/SpannableString"); In Chrome for Android we ...
6 years, 6 months ago (2014-06-10 00:30:49 UTC) #4
huangs
Updated, PTAL. https://codereview.chromium.org/313053007/diff/20001/content/browser/renderer_host/ime_adapter_android.cc File content/browser/renderer_host/ime_adapter_android.cc (right): https://codereview.chromium.org/313053007/diff/20001/content/browser/renderer_host/ime_adapter_android.cc#newcode72 content/browser/renderer_host/ime_adapter_android.cc:72: jclass clsSpannableString = env->FindClass("android/text/SpannableString"); On 2014/06/10 00:30:48, ...
6 years, 6 months ago (2014-06-10 04:39:13 UTC) #5
huangs
Updated CL to make AppendBackgroundColorSpan static. Added support of UnderlineSpan, which is passed by Google ...
6 years, 6 months ago (2014-06-10 18:06:35 UTC) #6
huangs
https://codereview.chromium.org/313053007/diff/40001/content/browser/renderer_host/ime_adapter_android.h File content/browser/renderer_host/ime_adapter_android.h (right): https://codereview.chromium.org/313053007/diff/40001/content/browser/renderer_host/ime_adapter_android.h#newcode45 content/browser/renderer_host/ime_adapter_android.h:45: void AppendBackgroundColorSpan(JNIEnv*, Cannot forward declare "public static" methods, since ...
6 years, 6 months ago (2014-06-10 18:09:47 UTC) #7
aurimas (slooooooooow)
https://codereview.chromium.org/313053007/diff/40001/content/browser/renderer_host/ime_adapter_android.h File content/browser/renderer_host/ime_adapter_android.h (right): https://codereview.chromium.org/313053007/diff/40001/content/browser/renderer_host/ime_adapter_android.h#newcode45 content/browser/renderer_host/ime_adapter_android.h:45: void AppendBackgroundColorSpan(JNIEnv*, On 2014/06/10 18:09:47, huangs1 wrote: > Cannot ...
6 years, 6 months ago (2014-06-10 18:36:19 UTC) #8
huangs
Updated, PTAL. https://codereview.chromium.org/313053007/diff/60001/content/browser/renderer_host/ime_adapter_android.cc File content/browser/renderer_host/ime_adapter_android.cc (right): https://codereview.chromium.org/313053007/diff/60001/content/browser/renderer_host/ime_adapter_android.cc#newcode92 content/browser/renderer_host/ime_adapter_android.cc:92: void AppendBackgroundColorSpan(JNIEnv*, On 2014/06/10 18:36:18, aurimas wrote: ...
6 years, 6 months ago (2014-06-10 19:54:53 UTC) #9
aurimas (slooooooooow)
lgtm for the following files: ImeAdapter.java AdapterInputConnection.java ime_adapter_android.* +tedchoc for another quick look over Androidy ...
6 years, 6 months ago (2014-06-10 20:06:36 UTC) #10
huangs
Updated. https://codereview.chromium.org/313053007/diff/80001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java (right): https://codereview.chromium.org/313053007/diff/80001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java#newcode532 content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java:532: if (!(text instanceof SpannableString)) I think here we ...
6 years, 6 months ago (2014-06-10 20:23:56 UTC) #11
palmer
IPC LGTM. Some comments about correct integer type. https://codereview.chromium.org/313053007/diff/80001/content/browser/renderer_host/ime_adapter_android.cc File content/browser/renderer_host/ime_adapter_android.cc (right): https://codereview.chromium.org/313053007/diff/80001/content/browser/renderer_host/ime_adapter_android.cc#newcode97 content/browser/renderer_host/ime_adapter_android.cc:97: jint ...
6 years, 6 months ago (2014-06-10 20:32:23 UTC) #12
Ted C
lgtm w/ some style nits https://codereview.chromium.org/313053007/diff/100001/content/browser/renderer_host/ime_adapter_android.cc File content/browser/renderer_host/ime_adapter_android.cc (right): https://codereview.chromium.org/313053007/diff/100001/content/browser/renderer_host/ime_adapter_android.cc#newcode104 content/browser/renderer_host/ime_adapter_android.cc:104: start, end, SK_ColorTRANSPARENT, false, ...
6 years, 6 months ago (2014-06-10 20:47:33 UTC) #13
piman
LGTM modulo existing style comments (run through git cl format?)
6 years, 6 months ago (2014-06-10 23:00:07 UTC) #14
huangs
Updated. Please note that this CL won't even compile without the prerequesite WebKit CL https://codereview.chromium.org/313233002/ ...
6 years, 6 months ago (2014-06-11 02:41:02 UTC) #15
huangs
Adding sadrul@chromium.org for OWNER review for ui\aura\remote_window_tree_host_win.cc
6 years, 6 months ago (2014-06-11 02:42:00 UTC) #16
sadrul
rslgtm https://codereview.chromium.org/313053007/diff/160001/ui/aura/remote_window_tree_host_win.cc File ui/aura/remote_window_tree_host_win.cc (right): https://codereview.chromium.org/313053007/diff/160001/ui/aura/remote_window_tree_host_win.cc#newcode80 ui/aura/remote_window_tree_host_win.cc:80: composition_text->underlines[i].background_color = SK_ColorTRANSPARENT; I assume you are not ...
6 years, 6 months ago (2014-06-11 21:49:39 UTC) #17
palmer
When you do your explicit conversion between signed and unsigned, it might make sense to ...
6 years, 6 months ago (2014-06-11 22:31:46 UTC) #18
huangs
Updated. With regard to explicit conversion: there are some contexts: - For color: any --> ...
6 years, 6 months ago (2014-06-12 20:25:35 UTC) #19
huangs
The CQ bit was checked by huangs@chromium.org
6 years, 6 months ago (2014-06-19 18:34:53 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/huangs@chromium.org/313053007/200001
6 years, 6 months ago (2014-06-19 18:37:21 UTC) #21
huangs
Ping nona@ for OWNER review of ui/base/ime/composition_text_util_pango.cc ui/base/ime/composition_text_util_pango_unittest.cc ui/base/ime/composition_underline.h ui/base/ime/input_method_chromeos.cc ui/base/ime/input_method_chromeos_unittest.cc ui/base/ime/win/imm32_manager.cc PTAL. Thanks!
6 years, 6 months ago (2014-06-19 21:53:18 UTC) #22
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_aosp on tryserver.chromium ...
6 years, 6 months ago (2014-06-19 23:07:48 UTC) #23
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-19 23:12:26 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/chromium_presubmit/builds/74969) linux_chromium_chromeos_clang_dbg on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/linux_chromium_chromeos_clang_dbg/builds/24577)
6 years, 6 months ago (2014-06-19 23:12:28 UTC) #25
Seigo Nonaka
lgtm lgtm with few comments :) https://chromiumcodereview.appspot.com/313053007/diff/200001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java (right): https://chromiumcodereview.appspot.com/313053007/diff/200001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java#newcode22 content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java:22: import java.lang.CharSequence; nit: ...
6 years, 6 months ago (2014-06-20 06:39:13 UTC) #26
huangs
Updated. Gonna commit! https://codereview.chromium.org/313053007/diff/200001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java (right): https://codereview.chromium.org/313053007/diff/200001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java#newcode22 content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java:22: import java.lang.CharSequence; On 2014/06/20 06:39:13, Seigo ...
6 years, 6 months ago (2014-06-20 14:28:25 UTC) #27
huangs
The CQ bit was checked by huangs@chromium.org
6 years, 6 months ago (2014-06-20 14:58:00 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/huangs@chromium.org/313053007/240001
6 years, 6 months ago (2014-06-20 15:00:04 UTC) #29
huangs
The CQ bit was unchecked by huangs@chromium.org
6 years, 6 months ago (2014-06-20 15:45:52 UTC) #30
huangs
Turns out we need import java.lang.CharSequence in ImeAdapter.java. Otherwise android_aosp produces JNI error.
6 years, 6 months ago (2014-06-20 15:58:35 UTC) #31
huangs
The CQ bit was checked by huangs@chromium.org
6 years, 6 months ago (2014-06-20 15:58:49 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/huangs@chromium.org/313053007/260001
6 years, 6 months ago (2014-06-20 16:00:42 UTC) #33
commit-bot: I haz the power
6 years, 6 months ago (2014-06-20 19:23:52 UTC) #34
Message was sent while issue was closed.
Change committed as 278794

Powered by Google App Engine
This is Rietveld 408576698