diff options
author | huangs@chromium.org <huangs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-20 19:23:48 +0000 |
---|---|---|
committer | huangs@chromium.org <huangs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-20 19:23:48 +0000 |
commit | 728b7eff5801c696bd5b4c00f7618c15c9c3a102 (patch) | |
tree | dd8e420ab365f95bf43a20b9f63dbd6ce74788f8 /ui/base/ime/win/imm32_manager.cc | |
parent | 60740513788fc4c870e0f120f3246a8db30ebfa8 (diff) | |
download | chromium_src-728b7eff5801c696bd5b4c00f7618c15c9c3a102.zip chromium_src-728b7eff5801c696bd5b4c00f7618c15c9c3a102.tar.gz chromium_src-728b7eff5801c696bd5b4c00f7618c15c9c3a102.tar.bz2 |
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
Review URL: https://codereview.chromium.org/313053007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278794 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/ime/win/imm32_manager.cc')
-rw-r--r-- | ui/base/ime/win/imm32_manager.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/ui/base/ime/win/imm32_manager.cc b/ui/base/ime/win/imm32_manager.cc index e1c9e9a..7ad2d87 100644 --- a/ui/base/ime/win/imm32_manager.cc +++ b/ui/base/ime/win/imm32_manager.cc @@ -83,10 +83,11 @@ void GetCompositionUnderlines(HIMC imm_context, underline.end_offset = clause_data[i+1]; underline.color = SK_ColorBLACK; underline.thick = false; + underline.background_color = SK_ColorTRANSPARENT; // Use thick underline for the target clause. - if (underline.start_offset >= static_cast<unsigned>(target_start) && - underline.end_offset <= static_cast<unsigned>(target_end)) { + if (underline.start_offset >= static_cast<uint32>(target_start) && + underline.end_offset <= static_cast<uint32>(target_end)) { underline.thick = true; } underlines->push_back(underline); @@ -342,21 +343,22 @@ void IMM32Manager::GetCompositionInfo(HIMC imm_context, LPARAM lparam, if (!composition->underlines.size()) { CompositionUnderline underline; underline.color = SK_ColorBLACK; + underline.background_color = SK_ColorTRANSPARENT; if (target_start > 0) { - underline.start_offset = 0; - underline.end_offset = target_start; + underline.start_offset = 0U; + underline.end_offset = static_cast<uint32>(target_start); underline.thick = false; composition->underlines.push_back(underline); } if (target_end > target_start) { - underline.start_offset = target_start; - underline.end_offset = target_end; + underline.start_offset = static_cast<uint32>(target_start); + underline.end_offset = static_cast<uint32>(target_end); underline.thick = true; composition->underlines.push_back(underline); } if (target_end < length) { - underline.start_offset = target_end; - underline.end_offset = length; + underline.start_offset = static_cast<uint32>(target_end); + underline.end_offset = static_cast<uint32>(length); underline.thick = false; composition->underlines.push_back(underline); } |