| 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 1cd3d57f99d2d9089cea51f8c47ef15d1e7ea930..e0bec72697f8fd8c5ac91cb0d94c41595469a002 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| @@ -461,10 +461,6 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host,
|
| popup_parent_host_view_(NULL),
|
| popup_child_host_view_(NULL),
|
| is_loading_(false),
|
| - text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
|
| - text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT),
|
| - text_input_flags_(0),
|
| - can_compose_inline_(true),
|
| has_composition_text_(false),
|
| accept_return_character_(false),
|
| last_swapped_software_frame_scale_factor_(1.f),
|
| @@ -779,18 +775,6 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() {
|
| }
|
| }
|
|
|
| -RenderFrameHostImpl* RenderWidgetHostViewAura::GetFocusedFrame() {
|
| - RenderViewHost* rvh = RenderViewHost::From(host_);
|
| - if (!rvh)
|
| - return nullptr;
|
| - FrameTreeNode* focused_frame =
|
| - rvh->GetDelegate()->GetFrameTree()->GetFocusedFrame();
|
| - if (!focused_frame)
|
| - return nullptr;
|
| -
|
| - return focused_frame->current_frame_host();
|
| -}
|
| -
|
| bool RenderWidgetHostViewAura::CanRendererHandleEvent(
|
| const ui::MouseEvent* event,
|
| bool mouse_locked,
|
| @@ -1004,23 +988,17 @@ void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) {
|
| UpdateCursorIfOverSelf();
|
| }
|
|
|
| -void RenderWidgetHostViewAura::TextInputStateChanged(
|
| - const ViewHostMsg_TextInputState_Params& params) {
|
| - if (text_input_type_ != params.type ||
|
| - text_input_mode_ != params.mode ||
|
| - can_compose_inline_ != params.can_compose_inline ||
|
| - text_input_flags_ != params.flags) {
|
| - text_input_type_ = params.type;
|
| - text_input_mode_ = params.mode;
|
| - can_compose_inline_ = params.can_compose_inline;
|
| - text_input_flags_ = params.flags;
|
| - if (GetInputMethod())
|
| - GetInputMethod()->OnTextInputTypeChanged(this);
|
| - }
|
| - if (params.show_ime_if_needed && params.type != ui::TEXT_INPUT_TYPE_NONE) {
|
| - if (GetInputMethod())
|
| - GetInputMethod()->ShowImeIfNeeded();
|
| - }
|
| +void RenderWidgetHostViewAura::NotifyTextInputStateChanged() {
|
| + RenderWidgetHostViewBase::NotifyTextInputStateChanged();
|
| +
|
| + if (!GetInputMethod())
|
| + return;
|
| +
|
| + GetInputMethod()->OnTextInputTypeChanged(this);
|
| +
|
| + const TextInputState* state = current_text_input_state();
|
| + if (state->show_ime_if_needed && state->type != ui::TEXT_INPUT_TYPE_NONE)
|
| + GetInputMethod()->ShowImeIfNeeded();
|
| }
|
|
|
| void RenderWidgetHostViewAura::ImeCancelComposition() {
|
| @@ -1643,7 +1621,7 @@ void RenderWidgetHostViewAura::ClearCompositionText() {
|
| }
|
|
|
| void RenderWidgetHostViewAura::InsertText(const base::string16& text) {
|
| - DCHECK(text_input_type_ != ui::TEXT_INPUT_TYPE_NONE);
|
| + DCHECK(current_text_input_state()->type != ui::TEXT_INPUT_TYPE_NONE);
|
| if (host_)
|
| host_->ImeConfirmComposition(text, gfx::Range::InvalidRange(), false);
|
| has_composition_text_ = false;
|
| @@ -1664,19 +1642,19 @@ void RenderWidgetHostViewAura::InsertChar(const ui::KeyEvent& event) {
|
| }
|
|
|
| ui::TextInputType RenderWidgetHostViewAura::GetTextInputType() const {
|
| - return text_input_type_;
|
| + return current_text_input_state()->type;
|
| }
|
|
|
| ui::TextInputMode RenderWidgetHostViewAura::GetTextInputMode() const {
|
| - return text_input_mode_;
|
| + return current_text_input_state()->mode;
|
| }
|
|
|
| int RenderWidgetHostViewAura::GetTextInputFlags() const {
|
| - return text_input_flags_;
|
| + return current_text_input_state()->flags;
|
| }
|
|
|
| bool RenderWidgetHostViewAura::CanComposeInline() const {
|
| - return can_compose_inline_;
|
| + return current_text_input_state()->can_compose_inline;
|
| }
|
|
|
| gfx::Rect RenderWidgetHostViewAura::ConvertRectToScreen(
|
|
|