Index: content/renderer/render_widget.cc |
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc |
index 1aab8b42fc06fd0573f5d5ab6d503e42ea25e637..5d7ac7f7298d14b8622960777007f867da87ad83 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 |
@@ -2087,9 +2088,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); |
@@ -2105,7 +2110,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( |