summaryrefslogtreecommitdiffstats
path: root/ui/events
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-02 23:17:06 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-02 23:17:06 +0000
commit8a698cedf44eaba88fbbb727ea1eaa32cbced8b7 (patch)
tree15c0f84e1ed80eb71e1ba04e5b00a979f5719165 /ui/events
parent224a8ebfccc24b073455a92c41fd25d65a6b9d75 (diff)
downloadchromium_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 'ui/events')
-rw-r--r--ui/events/event_target.cc4
-rw-r--r--ui/events/event_target.h3
2 files changed, 7 insertions, 0 deletions
diff --git a/ui/events/event_target.cc b/ui/events/event_target.cc
index 9aa53902..56b7a16 100644
--- a/ui/events/event_target.cc
+++ b/ui/events/event_target.cc
@@ -48,6 +48,10 @@ void EventTarget::RemovePostTargetHandler(EventHandler* handler) {
post_target_list_.erase(find);
}
+bool EventTarget::IsPreTargetListEmpty() const {
+ return pre_target_list_.empty();
+}
+
void EventTarget::OnEvent(Event* event) {
CHECK_EQ(this, event->target());
if (target_handler_)
diff --git a/ui/events/event_target.h b/ui/events/event_target.h
index 39671e2..12dbb35 100644
--- a/ui/events/event_target.h
+++ b/ui/events/event_target.h
@@ -70,6 +70,9 @@ class EVENTS_EXPORT EventTarget : public EventHandler {
void AddPostTargetHandler(EventHandler* handler);
void RemovePostTargetHandler(EventHandler* handler);
+ // Returns true if the event pre target list is empty.
+ bool IsPreTargetListEmpty() const;
+
protected:
void set_target_handler(EventHandler* handler) {
target_handler_ = handler;