| Index: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
|
| diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
|
| index 914c1d24a83c462a87c35a24314b3c2cb8a4f00d..08881b07338f3f573864a3c23e6f75fd1d8c2a64 100644
|
| --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
|
| +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
|
| @@ -15,6 +15,7 @@
|
| #include "ui/aura/window_property.h"
|
| #include "ui/aura/window_tree_host.h"
|
| #include "ui/base/hit_test.h"
|
| +#include "ui/base/ui_base_switches_util.h"
|
| #include "ui/compositor/layer.h"
|
| #include "ui/gfx/canvas.h"
|
| #include "ui/gfx/display.h"
|
| @@ -25,8 +26,8 @@
|
| #include "ui/views/corewm/tooltip.h"
|
| #include "ui/views/corewm/tooltip_controller.h"
|
| #include "ui/views/drag_utils.h"
|
| -#include "ui/views/ime/input_method.h"
|
| #include "ui/views/ime/input_method_bridge.h"
|
| +#include "ui/views/ime/null_input_method.h"
|
| #include "ui/views/view_constants_aura.h"
|
| #include "ui/views/widget/desktop_aura/desktop_capture_client.h"
|
| #include "ui/views/widget/desktop_aura/desktop_cursor_loader_updater.h"
|
| @@ -628,6 +629,9 @@ bool DesktopNativeWidgetAura::HasCapture() const {
|
| }
|
|
|
| InputMethod* DesktopNativeWidgetAura::CreateInputMethod() {
|
| + if (switches::IsTextInputFocusManagerEnabled())
|
| + return new NullInputMethod();
|
| +
|
| ui::InputMethod* host = input_method_event_filter_->input_method();
|
| return new InputMethodBridge(this, host, false);
|
| }
|
| @@ -637,6 +641,10 @@ internal::InputMethodDelegate*
|
| return this;
|
| }
|
|
|
| +ui::InputMethod* DesktopNativeWidgetAura::GetHostInputMethod() {
|
| + return input_method_event_filter_->input_method();
|
| +}
|
| +
|
| void DesktopNativeWidgetAura::CenterWindow(const gfx::Size& size) {
|
| if (content_window_)
|
| desktop_window_tree_host_->CenterWindow(size);
|
| @@ -1071,16 +1079,26 @@ void DesktopNativeWidgetAura::OnWindowFocused(aura::Window* gained_focus,
|
| desktop_window_tree_host_->OnNativeWidgetFocus();
|
| native_widget_delegate_->OnNativeFocus(lost_focus);
|
|
|
| - // If focus is moving from a descendant Window to |content_window_| then
|
| - // native activation hasn't changed. We still need to inform the InputMethod
|
| - // we've been focused though.
|
| - InputMethod* input_method = GetWidget()->GetInputMethod();
|
| - if (input_method)
|
| - input_method->OnFocus();
|
| + if (!switches::IsTextInputFocusManagerEnabled()) {
|
| + // If focus is moving from a descendant Window to |content_window_| then
|
| + // native activation hasn't changed. We still need to inform the
|
| + // InputMethod we've been focused though.
|
| + InputMethod* input_method = GetWidget()->GetInputMethod();
|
| + if (input_method)
|
| + input_method->OnFocus();
|
| + }
|
| +
|
| + // Ensure the focused view's TextInputClient is used for text input.
|
| + views::FocusManager* focus_manager = GetWidget()->GetFocusManager();
|
| + focus_manager->FocusTextInputClient(focus_manager->GetFocusedView());
|
| } else if (content_window_ == lost_focus) {
|
| desktop_window_tree_host_->OnNativeWidgetBlur();
|
| native_widget_delegate_->OnNativeBlur(
|
| aura::client::GetFocusClient(content_window_)->GetFocusedWindow());
|
| +
|
| + // Ensure the focused view's TextInputClient is not used for text input.
|
| + views::FocusManager* focus_manager = GetWidget()->GetFocusManager();
|
| + focus_manager->BlurTextInputClient(focus_manager->GetFocusedView());
|
| }
|
| }
|
|
|
|
|