diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-02 23:17:06 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-02 23:17:06 +0000 |
commit | 8a698cedf44eaba88fbbb727ea1eaa32cbced8b7 (patch) | |
tree | 15c0f84e1ed80eb71e1ba04e5b00a979f5719165 /ash | |
parent | 224a8ebfccc24b073455a92c41fd25d65a6b9d75 (diff) | |
download | chromium_src-8a698cedf44eaba88fbbb727ea1eaa32cbced8b7.zip chromium_src-8a698cedf44eaba88fbbb727ea1eaa32cbced8b7.tar.gz chromium_src-8a698cedf44eaba88fbbb727ea1eaa32cbced8b7.tar.bz2 |
Ensure that in Desktop AURA the WindowModalityController class is at the head of the event pre target handlers list.
This ensures that it handles input events first when modal windows are at the top of the Zorder.
This logic has been added to the DesktopNativeWidgetAura::InstallWindowModalityController function which is called by the
DesktopRootWindowHost implementations on windows and linux when the root window is created.
The logic in ash shell.cc has also been changed to instantiate the WindowModalityController object at the beginning. The
class WindowModalityController now takes the EventTarget as an argument in its ctor and adds itself to the pre target
list. Added a DCHECK here to check if the pre target list in the EventTarget is empty. The WindowModalityController removes
itself from the pre target list in its dtor.
BUG=299662
R=sky@chromium.org, sky
TEST=Covered by Desktop AURA widget test WindowMouseModalityTest
Review URL: https://codereview.chromium.org/25445002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226609 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/shell.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/ash/shell.cc b/ash/shell.cc index bea797a..5b337e7 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -192,7 +192,6 @@ Shell::Shell(ShellDelegate* delegate) // messages don't have a target window. base::MessagePumpX11::Current()->AddObserver(output_configurator()); #endif // defined(OS_CHROMEOS) - AddPreTargetHandler(this); #if defined(OS_CHROMEOS) internal::PowerStatus::Initialize(); @@ -210,11 +209,12 @@ Shell::~Shell() { aura::client::GetFocusClient(GetPrimaryRootWindow())->FocusWindow(NULL); // Please keep in same order as in Init() because it's easy to miss one. + if (window_modality_controller_) + window_modality_controller_.reset(); RemovePreTargetHandler(event_rewriter_filter_.get()); RemovePreTargetHandler(user_activity_detector_.get()); RemovePreTargetHandler(overlay_filter_.get()); RemovePreTargetHandler(input_method_filter_.get()); - RemovePreTargetHandler(window_modality_controller_.get()); if (mouse_cursor_filter_) RemovePreTargetHandler(mouse_cursor_filter_.get()); RemovePreTargetHandler(system_gesture_filter_.get()); @@ -427,6 +427,14 @@ void Shell::Init() { // Launcher, and WallPaper could be created by the factory. views::FocusManagerFactory::Install(new AshFocusManagerFactory); + // The WindowModalityController needs to be at the front of the input event + // pretarget handler list to ensure that it processes input events when modal + // windows are active. + window_modality_controller_.reset( + new views::corewm::WindowModalityController(this)); + + AddPreTargetHandler(this); + env_filter_.reset(new views::corewm::CompoundEventFilter); AddPreTargetHandler(env_filter_.get()); @@ -505,9 +513,6 @@ void Shell::Init() { // RootWindowController as possible. visibility_controller_.reset(new AshVisibilityController); user_action_client_.reset(delegate_->CreateUserActionClient()); - window_modality_controller_.reset( - new views::corewm::WindowModalityController); - AddPreTargetHandler(window_modality_controller_.get()); magnification_controller_.reset( MagnificationController::CreateInstance()); |