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; |
} |