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

Unified Diff: content/renderer/render_widget.cc

Issue 1589953005: Support InputMethodManager#updateCursorAnchorInfo for Android 5.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Findbugs warning / Simplify the state transition. Created 4 years, 10 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 592a57c0c1d3a076f4b8354c9affead6d7f5bdd3..197b5ab145230e84ab776c2a3e381a10fbe04643 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -87,6 +87,7 @@
#if defined(OS_ANDROID)
#include <android/keycodes.h>
+#include "base/android/build_info.h"
#include "content/renderer/android/synchronous_compositor_factory.h"
#include "content/renderer/android/synchronous_compositor_filter.h"
#include "content/renderer/android/synchronous_compositor_output_surface.h"
@@ -1748,9 +1749,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 &&
aelias_OOO_until_Jul13 2016/02/10 08:23:42 We shouldn't add an SDK version level check in the
kinaba 2016/02/19 12:44:08 I guess devices stuck at K or below tends to be ol
jdduke (slow) 2016/02/19 16:28:07 Seems reasonable. I suppose you could gait the fla
aelias_OOO_until_Jul13 2016/02/24 03:16:39 Regardless of the history, I stand by what I said
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableCursorAnchorInfo);
+ if (!is_cursor_anchor_info_supported)
+ return;
+#endif
TRACE_EVENT0("renderer", "RenderWidget::UpdateCompositionInfo");
gfx::Range range = gfx::Range();
if (should_update_range) {
@@ -1767,7 +1772,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::convertViewportToWindow(blink::WebRect* rect) {

Powered by Google App Engine
This is Rietveld 408576698