diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-30 22:08:41 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-30 22:08:41 +0000 |
commit | 5097e69c0a342fddf6b6d8f143058f14185a6fb8 (patch) | |
tree | f36f83196fd0e55aeea3f0645f59d859ad1ef6a8 /ui/aura | |
parent | 1cf62ccc51256414f52fa0b15e32f4fac5451f53 (diff) | |
download | chromium_src-5097e69c0a342fddf6b6d8f143058f14185a6fb8.zip chromium_src-5097e69c0a342fddf6b6d8f143058f14185a6fb8.tar.gz chromium_src-5097e69c0a342fddf6b6d8f143058f14185a6fb8.tar.bz2 |
Relanding the EventTarget fixes for Aura (Ash) as the previous attempt was reverted due to interactive test failures
on the linux_chromeos builder.
Disabled the failing BookmarkBarViewTest8.DNDBackToOriginatingMenu test on AURA for now and logged a bug
http://code.google.com/p/chromium/issues/detail?id=158564&thanks=158564 to track this. Will work on that in a subsequent
change.
Register a separate default ui::EventTarget for Aura (Ash) to ensure that it does not interfere with the
event handling in desktop chrome in Aura.
On Windows 8 in chrome metro mode we have a desktop chrome process
which runs as a server to the viewer process in Metro. Reusing the default EventTarget across both environments
causes desktop chrome to crash as a number of EventFilters registered on the default EventTarget get called twice.
The Ash specific EventTarget is implemented by the Ash::Shell class. The RootWindow in its GetParentTarget implementation
delegates this call to the EventClient implementation if one exists and if not it returns the default Aura::Env interface.
The EventClient interface is implemented by Ash and has been updated to return the default EventTarget via the new method
GetToplevelEventTarget
Fixes bug http://code.google.com/p/chromium/issues/detail?id=158105
BUG=158105
R=ben
Review URL: https://codereview.chromium.org/11273098
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165026 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura')
-rw-r--r-- | ui/aura/client/event_client.h | 3 | ||||
-rw-r--r-- | ui/aura/root_window.cc | 4 | ||||
-rw-r--r-- | ui/aura/root_window_unittest.cc | 4 |
3 files changed, 10 insertions, 1 deletions
diff --git a/ui/aura/client/event_client.h b/ui/aura/client/event_client.h index 077e959..31565e2 100644 --- a/ui/aura/client/event_client.h +++ b/ui/aura/client/event_client.h @@ -21,6 +21,9 @@ class AURA_EXPORT EventClient { // Returns true if events can be processed by |window| or any of its children. virtual bool CanProcessEventsWithinSubtree(const Window* window) const = 0; + // Returns the top level EventTarget for the current environment. + virtual ui::EventTarget* GetToplevelEventTarget() = 0; + protected: virtual ~EventClient() {} }; diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc index 0c0b79d..b9712bd 100644 --- a/ui/aura/root_window.cc +++ b/ui/aura/root_window.cc @@ -452,7 +452,9 @@ void RootWindow::SetTransform(const gfx::Transform& transform) { // RootWindow, ui::EventTarget implementation: ui::EventTarget* RootWindow::GetParentTarget() { - return Env::GetInstance(); + return client::GetEventClient(this) ? + client::GetEventClient(this)->GetToplevelEventTarget() : + Env::GetInstance(); } //////////////////////////////////////////////////////////////////////////////// diff --git a/ui/aura/root_window_unittest.cc b/ui/aura/root_window_unittest.cc index 20e7cbb..460e4cc 100644 --- a/ui/aura/root_window_unittest.cc +++ b/ui/aura/root_window_unittest.cc @@ -336,6 +336,10 @@ class TestEventClient : public client::EventClient { return lock_ ? GetLockWindow()->Contains(window) : true; } + virtual ui::EventTarget* GetToplevelEventTarget() OVERRIDE { + return NULL; + } + RootWindow* root_window_; bool lock_; |