summaryrefslogtreecommitdiffstats
path: root/ash/host
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-22 20:36:11 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-22 20:36:11 +0000
commit8f5209c89cbd2e2d34ed5719e6f5007ce7a6aba3 (patch)
tree024fd96cef44f82ca2b7ff59e37ef19f1939c1ad /ash/host
parent78cd68e0d88496f769b46bb789ea19b0ee132e99 (diff)
downloadchromium_src-8f5209c89cbd2e2d34ed5719e6f5007ce7a6aba3.zip
chromium_src-8f5209c89cbd2e2d34ed5719e6f5007ce7a6aba3.tar.gz
chromium_src-8f5209c89cbd2e2d34ed5719e6f5007ce7a6aba3.tar.bz2
Remove dispatcher when shutting down RootWindowController
Resurrecting PrepareForShutdown as it can be implemented onl in ash. BUG=None Review URL: https://codereview.chromium.org/294073006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272308 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/host')
-rw-r--r--ash/host/ash_window_tree_host.h5
-rw-r--r--ash/host/ash_window_tree_host_x11.cc7
-rw-r--r--ash/host/ash_window_tree_host_x11.h1
3 files changed, 12 insertions, 1 deletions
diff --git a/ash/host/ash_window_tree_host.h b/ash/host/ash_window_tree_host.h
index 1d1513b..b9c617f 100644
--- a/ash/host/ash_window_tree_host.h
+++ b/ash/host/ash_window_tree_host.h
@@ -53,7 +53,10 @@ class ASH_EXPORT AshWindowTreeHost {
// mode dual monitors case). If the root window is only associated with one
// display id, then the other id should be set to
// gfx::Display::kInvalidDisplayID.
- virtual void UpdateDisplayID(int64 id1, int64 id2) {};
+ virtual void UpdateDisplayID(int64 id1, int64 id2) {}
+
+ // Stop listening for events in preparation for shutdown.
+ virtual void PrepareForShutdown() {}
};
} // namespace ash
diff --git a/ash/host/ash_window_tree_host_x11.cc b/ash/host/ash_window_tree_host_x11.cc
index eff9ba6..beb129f 100644
--- a/ash/host/ash_window_tree_host_x11.cc
+++ b/ash/host/ash_window_tree_host_x11.cc
@@ -19,9 +19,11 @@
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/env.h"
#include "ui/aura/window.h"
+#include "ui/aura/window_event_dispatcher.h"
#include "ui/base/x/x11_util.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
+#include "ui/events/platform/platform_event_source.h"
#include "ui/events/x/device_data_manager.h"
#include "ui/events/x/device_list_cache_x.h"
#include "ui/events/x/touch_factory_x11.h"
@@ -129,6 +131,11 @@ void AshWindowTreeHostX11::UpdateDisplayID(int64 id1, int64 id2) {
display_ids_.second = id2;
}
+void AshWindowTreeHostX11::PrepareForShutdown() {
+ if (ui::PlatformEventSource::GetInstance())
+ ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
+}
+
void AshWindowTreeHostX11::SetBounds(const gfx::Rect& bounds) {
WindowTreeHostX11::SetBounds(bounds);
if (pointer_barriers_) {
diff --git a/ash/host/ash_window_tree_host_x11.h b/ash/host/ash_window_tree_host_x11.h
index 8b998be..1a3335d 100644
--- a/ash/host/ash_window_tree_host_x11.h
+++ b/ash/host/ash_window_tree_host_x11.h
@@ -33,6 +33,7 @@ class ASH_EXPORT AshWindowTreeHostX11 : public AshWindowTreeHost,
virtual gfx::Insets GetHostInsets() const OVERRIDE;
virtual aura::WindowTreeHost* AsWindowTreeHost() OVERRIDE;
virtual void UpdateDisplayID(int64 id1, int64 id2) OVERRIDE;
+ virtual void PrepareForShutdown() OVERRIDE;
// aura::WindowTreehost:
virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;