diff options
author | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-03 19:50:42 +0000 |
---|---|---|
committer | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-03 19:50:42 +0000 |
commit | 99951c903a5ed6f424b74fad765e7310377ea67e (patch) | |
tree | 986fd8ab09a632afdfc6db3bbf82d840382b331a /apps/shell | |
parent | a0412516dc130d04866245d75e2c0834fc64fb8f (diff) | |
download | chromium_src-99951c903a5ed6f424b74fad765e7310377ea67e.zip chromium_src-99951c903a5ed6f424b74fad765e7310377ea67e.tar.gz chromium_src-99951c903a5ed6f424b74fad765e7310377ea67e.tar.bz2 |
Fixes the initialization of focus and activation management.
- We don't have to use DefaultActivationController because
wm::FocusController provides activation controls.
- FocusController should be registered as a pre-target handler
to change the focus on mouse click.
- InitializeInputMethodForTesting seems unnecessary. Text input
is working well while no actual input methods are available.
BUG=None
R=jamescook@chromium.org, oshima@chromium.org
TEST=manually
Review URL: https://codereview.chromium.org/310463010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274596 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps/shell')
-rw-r--r-- | apps/shell/browser/shell_desktop_controller.cc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/apps/shell/browser/shell_desktop_controller.cc b/apps/shell/browser/shell_desktop_controller.cc index 752b198..396758f 100644 --- a/apps/shell/browser/shell_desktop_controller.cc +++ b/apps/shell/browser/shell_desktop_controller.cc @@ -22,7 +22,6 @@ #include "ui/wm/core/base_focus_rules.h" #include "ui/wm/core/compound_event_filter.h" #include "ui/wm/core/cursor_manager.h" -#include "ui/wm/core/default_activation_client.h" #include "ui/wm/core/focus_controller.h" #include "ui/wm/core/input_method_event_filter.h" #include "ui/wm/core/native_cursor_manager.h" @@ -231,8 +230,7 @@ void ShellDesktopController::CreateRootWindow() { test_screen_.reset(aura::TestScreen::Create()); // TODO(jamescook): Replace this with a real Screen implementation. gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); - // TODO(jamescook): Initialize a real input method. - ui::InitializeInputMethodForTesting(); + // TODO(mukai): Set up input method. // Set up basic pieces of ui::wm. gfx::Size size = GetPrimaryDisplaySize(); @@ -253,16 +251,18 @@ void ShellDesktopController::CreateRootWindow() { } void ShellDesktopController::InitWindowManager() { - focus_client_.reset(new wm::FocusController(new AppsFocusRules())); - aura::client::SetFocusClient(host_->window(), focus_client_.get()); + wm::FocusController* focus_controller = + new wm::FocusController(new AppsFocusRules()); + aura::client::SetFocusClient(host_->window(), focus_controller); + host_->window()->AddPreTargetHandler(focus_controller); + aura::client::SetActivationClient(host_->window(), focus_controller); + focus_client_.reset(focus_controller); input_method_filter_.reset( new wm::InputMethodEventFilter(host_->GetAcceleratedWidget())); input_method_filter_->SetInputMethodPropertyInRootWindow(host_->window()); root_window_event_filter_->AddHandler(input_method_filter_.get()); - new wm::DefaultActivationClient(host_->window()); - capture_client_.reset( new aura::client::DefaultCaptureClient(host_->window())); @@ -294,6 +294,12 @@ void ShellDesktopController::DestroyRootWindow() { host_->event_processor()->GetRootTarget()->RemovePreTargetHandler( user_activity_detector_.get()); } + wm::FocusController* focus_controller = + static_cast<wm::FocusController*>(focus_client_.get()); + if (focus_controller) { + host_->window()->RemovePreTargetHandler(focus_controller); + aura::client::SetActivationClient(host_->window(), NULL); + } root_window_event_filter_.reset(); capture_client_.reset(); input_method_filter_.reset(); @@ -304,7 +310,6 @@ void ShellDesktopController::DestroyRootWindow() { #endif user_activity_detector_.reset(); host_.reset(); - ui::ShutdownInputMethodForTesting(); } gfx::Size ShellDesktopController::GetPrimaryDisplaySize() { |