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

Unified Diff: content/renderer/render_widget.cc

Issue 699333003: Support InputMethodManager#updateCursorAnchorInfo for Android 5.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase before splitting this CL. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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(

Powered by Google App Engine
This is Rietveld 408576698