summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-29 20:07:35 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-29 20:07:35 +0000
commit30275cedc43837db75c1a2ef8f1c22989388f346 (patch)
tree7758c807923634a737f2a502069aa67ad2f4e50e
parent89627f9d7fba44faaabee1e41f5f672f2e83cc2e (diff)
downloadchromium_src-30275cedc43837db75c1a2ef8f1c22989388f346.zip
chromium_src-30275cedc43837db75c1a2ef8f1c22989388f346.tar.gz
chromium_src-30275cedc43837db75c1a2ef8f1c22989388f346.tar.bz2
Revert 164703 - it broke BookmarkBarViewTest8.DNDBackToOriginatingMenu on Chrome OS - 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/11314013 TBR=ananta@chromium.org Review URL: https://codereview.chromium.org/11301024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164728 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/shell.cc12
-rw-r--r--ash/shell.h8
-rw-r--r--ash/wm/event_client_impl.cc4
-rw-r--r--ash/wm/event_client_impl.h1
-rw-r--r--ui/aura/client/event_client.h3
-rw-r--r--ui/aura/root_window.cc4
-rw-r--r--ui/aura/root_window_unittest.cc4
7 files changed, 4 insertions, 32 deletions
diff --git a/ash/shell.cc b/ash/shell.cc
index 6ab1289..2a2cc58 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -510,11 +510,11 @@ void Shell::Init() {
}
void Shell::AddEnvEventFilter(aura::EventFilter* filter) {
- AddPreTargetHandler(filter);
+ aura::Env::GetInstance()->AddPreTargetHandler(filter);
}
void Shell::RemoveEnvEventFilter(aura::EventFilter* filter) {
- RemovePreTargetHandler(filter);
+ aura::Env::GetInstance()->RemovePreTargetHandler(filter);
}
void Shell::ShowContextMenu(const gfx::Point& location_in_screen) {
@@ -802,12 +802,4 @@ bool Shell::CanWindowReceiveEvents(aura::Window* window) {
return false;
}
-bool Shell::CanAcceptEvents() {
- return true;
-}
-
-ui::EventTarget* Shell::GetParentTarget() {
- return NULL;
-}
-
} // namespace ash
diff --git a/ash/shell.h b/ash/shell.h
index 0622130..430e0c2 100644
--- a/ash/shell.h
+++ b/ash/shell.h
@@ -18,7 +18,6 @@
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
-#include "ui/base/events/event_target.h"
#include "ui/gfx/insets.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/size.h"
@@ -115,8 +114,7 @@ class WorkspaceController;
//
// Upon creation, the Shell sets itself as the RootWindow's delegate, which
// takes ownership of the Shell.
-class ASH_EXPORT Shell : internal::SystemModalContainerEventFilterDelegate,
- public ui::EventTarget {
+class ASH_EXPORT Shell : internal::SystemModalContainerEventFilterDelegate{
public:
typedef std::vector<aura::RootWindow*> RootWindowList;
typedef std::vector<internal::RootWindowController*> RootWindowControllerList;
@@ -426,10 +424,6 @@ class ASH_EXPORT Shell : internal::SystemModalContainerEventFilterDelegate,
// ash::internal::SystemModalContainerEventFilterDelegate overrides:
virtual bool CanWindowReceiveEvents(aura::Window* window) OVERRIDE;
- // Overridden from ui::EventTarget:
- virtual bool CanAcceptEvents() OVERRIDE;
- virtual EventTarget* GetParentTarget() OVERRIDE;
-
static Shell* instance_;
// If set before the Shell is initialized, the mouse cursor will be hidden
diff --git a/ash/wm/event_client_impl.cc b/ash/wm/event_client_impl.cc
index 8f9a91b..f7fc8b2 100644
--- a/ash/wm/event_client_impl.cc
+++ b/ash/wm/event_client_impl.cc
@@ -38,9 +38,5 @@ bool EventClientImpl::CanProcessEventsWithinSubtree(
return true;
}
-ui::EventTarget* EventClientImpl::GetToplevelEventTarget() {
- return Shell::GetInstance();
-}
-
} // namespace internal
} // namespace ash
diff --git a/ash/wm/event_client_impl.h b/ash/wm/event_client_impl.h
index 897e881..3702709 100644
--- a/ash/wm/event_client_impl.h
+++ b/ash/wm/event_client_impl.h
@@ -24,7 +24,6 @@ class EventClientImpl : public aura::client::EventClient {
// Overridden from aura::client::EventClient:
virtual bool CanProcessEventsWithinSubtree(
const aura::Window* window) const OVERRIDE;
- virtual ui::EventTarget* GetToplevelEventTarget() OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(EventClientImpl);
};
diff --git a/ui/aura/client/event_client.h b/ui/aura/client/event_client.h
index 31565e2..077e959 100644
--- a/ui/aura/client/event_client.h
+++ b/ui/aura/client/event_client.h
@@ -21,9 +21,6 @@ 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 b9712bd..0c0b79d 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -452,9 +452,7 @@ void RootWindow::SetTransform(const gfx::Transform& transform) {
// RootWindow, ui::EventTarget implementation:
ui::EventTarget* RootWindow::GetParentTarget() {
- return client::GetEventClient(this) ?
- client::GetEventClient(this)->GetToplevelEventTarget() :
- Env::GetInstance();
+ return Env::GetInstance();
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/ui/aura/root_window_unittest.cc b/ui/aura/root_window_unittest.cc
index 460e4cc..20e7cbb 100644
--- a/ui/aura/root_window_unittest.cc
+++ b/ui/aura/root_window_unittest.cc
@@ -336,10 +336,6 @@ class TestEventClient : public client::EventClient {
return lock_ ? GetLockWindow()->Contains(window) : true;
}
- virtual ui::EventTarget* GetToplevelEventTarget() OVERRIDE {
- return NULL;
- }
-
RootWindow* root_window_;
bool lock_;