| Index: content/renderer/render_widget.cc
|
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
|
| index d9dbe21ce1cbb745540202a7b985521962c3e388..ccda44a7695b27562ef3f37b21d40edc931bee5b 100644
|
| --- a/content/renderer/render_widget.cc
|
| +++ b/content/renderer/render_widget.cc
|
| @@ -82,6 +82,7 @@
|
|
|
| #if defined(OS_ANDROID)
|
| #include <android/keycodes.h>
|
| +#include "base/android/build_info.h"
|
| #include "content/renderer/android/synchronous_compositor_factory.h"
|
| #endif
|
|
|
| @@ -2076,9 +2077,13 @@ ui::TextInputType RenderWidget::GetTextInputType() {
|
|
|
| void RenderWidget::UpdateCompositionInfo(bool should_update_range) {
|
| #if defined(OS_ANDROID)
|
| - // TODO(yukawa): Start sending character bounds when the browser side
|
| - // implementation becomes ready (crbug.com/424866).
|
| -#else
|
| + const static bool is_cursor_anchor_info_supported =
|
| + base::android::BuildInfo::GetInstance()->sdk_int() >= 21 &&
|
| + base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnableCursorAnchorInfo);
|
| + if (!is_cursor_anchor_info_supported)
|
| + return;
|
| +#endif
|
| gfx::Range range = gfx::Range();
|
| if (should_update_range) {
|
| GetCompositionRange(&range);
|
| @@ -2094,7 +2099,6 @@ void RenderWidget::UpdateCompositionInfo(bool should_update_range) {
|
| composition_range_ = range;
|
| Send(new InputHostMsg_ImeCompositionRangeChanged(
|
| routing_id(), composition_range_, composition_character_bounds_));
|
| -#endif
|
| }
|
|
|
| void RenderWidget::GetCompositionCharacterBounds(
|
|
|