Plumb composition character bounds for Android 5.0
This is a groundwork to support CursorAnchorInfo API for Android 5.0. No user visible change is intended with this CL.
With this CL, ImeCompositionRangeChanged event will be routed from the renderer to the browser in Android 5.0 and above. The underlying functionality has been widely used in desktop OSes for years. There should be no performance impact for existing in Android 4.4 and prior version. Performance impact on Android 5.0 devices will be tracked as Issue 427090. Actual plumbing from native to Java layer will be handled in subsequent CLs.
BUG=424866, 427090
TEST=Manually done on Nexus 7 Build/LPX13D
Review URL: https://codereview.chromium.org/671503005
Cr-Commit-Position: refs/heads/master@{#301384}
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index 6b17db7..1ee18a4 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -292,10 +292,11 @@
void UpdateTextInputState(ShowIme show_ime, ChangeSource change_source);
#endif
-#if defined(OS_MACOSX) || defined(USE_AURA)
+#if defined(OS_MACOSX) || defined(USE_AURA) || defined(OS_ANDROID)
// Checks if the composition range or composition character bounds have been
// changed. If they are changed, the new value will be sent to the browser
- // process.
+ // process. This method does nothing when the browser process is not able to
+ // handle composition range and composition character bounds.
void UpdateCompositionInfo(bool should_update_range);
#endif
@@ -471,7 +472,7 @@
virtual ui::TextInputType WebKitToUiTextInputType(
blink::WebTextInputType type);
-#if defined(OS_MACOSX) || defined(USE_AURA)
+#if defined(OS_MACOSX) || defined(USE_AURA) || defined(OS_ANDROID)
// Override point to obtain that the current composition character bounds.
// In the case of surrogate pairs, the character is treated as two characters:
// the bounds for first character is actual one, and the bounds for second