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

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

Issue 2095813002: Revert of Routing IME Result Calls to the Correct RenderWidgetHost (Aura Only) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 ea227ffbbcebbc8d564e00e9abff438cfc35c009..909c4883f211fc797bae09149dc941751c8689d4 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1438,7 +1438,8 @@
// RenderWidgetHostViewAura, ui::TextInputClient implementation:
void RenderWidgetHostViewAura::SetCompositionText(
const ui::CompositionText& composition) {
- if (!text_input_manager_ || !text_input_manager_->GetActiveWidget())
+ // TODO(wjmaclean): can host_ ever be null?
+ if (!host_)
return;
// TODO(suzhe): convert both renderer_host and renderer to use
@@ -1458,36 +1459,36 @@
// TODO(suzhe): due to a bug of webkit, we can't use selection range with
// composition string. See: https://bugs.webkit.org/show_bug.cgi?id=37788
- text_input_manager_->GetActiveWidget()->ImeSetComposition(
- composition.text, underlines, gfx::Range::InvalidRange(),
- composition.selection.end(), composition.selection.end());
+ host_->ImeSetComposition(composition.text, underlines,
+ gfx::Range::InvalidRange(),
+ composition.selection.end(),
+ composition.selection.end());
has_composition_text_ = !composition.text.empty();
}
void RenderWidgetHostViewAura::ConfirmCompositionText() {
- if (text_input_manager_ && text_input_manager_->GetActiveWidget() &&
- has_composition_text_) {
- text_input_manager_->GetActiveWidget()->ImeConfirmComposition(
- base::string16(), gfx::Range::InvalidRange(), false);
+ // TODO(wjmaclean): can host_ ever be null?
+ if (host_ && has_composition_text_) {
+ host_->ImeConfirmComposition(base::string16(), gfx::Range::InvalidRange(),
+ false);
}
has_composition_text_ = false;
}
void RenderWidgetHostViewAura::ClearCompositionText() {
- if (text_input_manager_ && text_input_manager_->GetActiveWidget() &&
- has_composition_text_)
- text_input_manager_->GetActiveWidget()->ImeCancelComposition();
+ // TODO(wjmaclean): can host_ ever be null?
+ if (host_ && has_composition_text_)
+ host_->ImeCancelComposition();
has_composition_text_ = false;
}
void RenderWidgetHostViewAura::InsertText(const base::string16& text) {
DCHECK_NE(GetTextInputType(), ui::TEXT_INPUT_TYPE_NONE);
- if (text_input_manager_ && text_input_manager_->GetActiveWidget()) {
- text_input_manager_->GetActiveWidget()->ImeConfirmComposition(
- text, gfx::Range::InvalidRange(), false);
- }
+ // TODO(wjmaclean): can host_ ever be null?
+ if (host_)
+ host_->ImeConfirmComposition(text, gfx::Range::InvalidRange(), false);
has_composition_text_ = false;
}

Powered by Google App Engine
This is Rietveld 408576698