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

Unified Diff: content/renderer/render_widget.cc

Issue 671503005: Plumb composition character bounds for Android 5.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « content/renderer/render_widget.h ('k') | content/test/test_render_view_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 57b7abfd8fc6e5dbfa959e7643050d997c4e9ee7..79f150b2f9703192430c280bfc46d835cf818af0 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -77,6 +77,7 @@
#if defined(OS_ANDROID)
#include <android/keycodes.h>
+#include "base/android/build_info.h"
#include "content/renderer/android/synchronous_compositor_factory.h"
#endif
@@ -1541,7 +1542,7 @@ void RenderWidget::OnImeSetComposition(
// sure we are in a consistent state.
Send(new InputHostMsg_ImeCancelComposition(routing_id()));
}
-#if defined(OS_MACOSX) || defined(USE_AURA)
+#if defined(OS_MACOSX) || defined(USE_AURA) || defined(OS_ANDROID)
UpdateCompositionInfo(true);
aurimas (slooooooooow) 2014/10/22 00:59:04 UpdateCompositionInfo is an expensive call. That w
yukawa 2014/10/22 01:11:35 Not yet, but this is why I added the the version c
#endif
}
@@ -1560,7 +1561,7 @@ void RenderWidget::OnImeConfirmComposition(const base::string16& text,
else
webwidget_->confirmComposition(WebWidget::DoNotKeepSelection);
handling_input_event_ = false;
-#if defined(OS_MACOSX) || defined(USE_AURA)
+#if defined(OS_MACOSX) || defined(USE_AURA) || defined(OS_ANDROID)
UpdateCompositionInfo(true);
#endif
}
@@ -1886,7 +1887,7 @@ void RenderWidget::UpdateSelectionBounds() {
}
}
-#if defined(OS_MACOSX) || defined(USE_AURA)
+#if defined(OS_MACOSX) || defined(USE_AURA) || defined(OS_ANDROID)
UpdateCompositionInfo(false);
#endif
}
@@ -1941,8 +1942,15 @@ ui::TextInputType RenderWidget::GetTextInputType() {
return ui::TEXT_INPUT_TYPE_NONE;
}
-#if defined(OS_MACOSX) || defined(USE_AURA)
+#if defined(OS_MACOSX) || defined(USE_AURA) || defined(OS_ANDROID)
void RenderWidget::UpdateCompositionInfo(bool should_update_range) {
+#if defined(OS_ANDROID)
+ // Sending composition info makes sense only in Lollipop (API level 21)
+ // and above due to the API availability.
+ if (base::android::BuildInfo::GetInstance()->sdk_int() < 21)
+ return;
+#endif
+
gfx::Range range = gfx::Range();
if (should_update_range) {
GetCompositionRange(&range);
@@ -2034,7 +2042,7 @@ void RenderWidget::resetInputMethod() {
Send(new InputHostMsg_ImeCancelComposition(routing_id()));
}
-#if defined(OS_MACOSX) || defined(USE_AURA)
+#if defined(OS_MACOSX) || defined(USE_AURA) || defined(OS_ANDROID)
UpdateCompositionInfo(true);
#endif
}
« no previous file with comments | « content/renderer/render_widget.h ('k') | content/test/test_render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698