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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 2132633002: Tracking composition range on the browser side (Aura) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing creis@'s comments and changing a test method Created 4 years, 5 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/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 7940896835bfe89771a903f186ec65da81513879..94f1d0ddad9734f5606aeb9999ad1c5b59392984 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -976,12 +976,6 @@ void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) {
UpdateCursorIfOverSelf();
}
-void RenderWidgetHostViewAura::ImeCompositionRangeChanged(
- const gfx::Range& range,
- const std::vector<gfx::Rect>& character_bounds) {
- composition_character_bounds_ = character_bounds;
-}
-
void RenderWidgetHostViewAura::RenderProcessGone(base::TerminationStatus status,
int error_code) {
UpdateCursorIfOverSelf();
@@ -1533,9 +1527,15 @@ bool RenderWidgetHostViewAura::GetCompositionCharacterBounds(
uint32_t index,
gfx::Rect* rect) const {
DCHECK(rect);
- if (index >= composition_character_bounds_.size())
+
+ if (!text_input_manager_ || !text_input_manager_->GetActiveWidget())
+ return false;
+
+ const std::vector<gfx::Rect>* composition_character_bounds =
+ text_input_manager_->GetCompositionCharacterBounds();
+ if (index >= composition_character_bounds->size())
return false;
- *rect = ConvertRectToScreen(composition_character_bounds_[index]);
+ *rect = ConvertRectToScreen(composition_character_bounds->at(index));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698