diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-19 20:34:43 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-19 20:34:43 +0000 |
commit | 84c60ce1272afcfa8716817eb9061e1ef7132136 (patch) | |
tree | 9a9a7852728dc80ec70b6d9f708f871dd6854d1b /ash/display | |
parent | 74fb600c88a969b60e9d9727e0ab39f9e753e156 (diff) | |
download | chromium_src-84c60ce1272afcfa8716817eb9061e1ef7132136.zip chromium_src-84c60ce1272afcfa8716817eb9061e1ef7132136.tar.gz chromium_src-84c60ce1272afcfa8716817eb9061e1ef7132136.tar.bz2 |
Remove PrepareForShutdown
Filter events after shutdown in event filter instead.
BUG=None
Review URL: https://codereview.chromium.org/196573023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258077 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/display')
-rw-r--r-- | ash/display/mouse_cursor_event_filter.cc | 12 | ||||
-rw-r--r-- | ash/display/screen_ash.cc | 6 |
2 files changed, 15 insertions, 3 deletions
diff --git a/ash/display/mouse_cursor_event_filter.cc b/ash/display/mouse_cursor_event_filter.cc index 3710d73..a91fc64 100644 --- a/ash/display/mouse_cursor_event_filter.cc +++ b/ash/display/mouse_cursor_event_filter.cc @@ -8,6 +8,7 @@ #include "ash/display/display_controller.h" #include "ash/display/display_manager.h" #include "ash/display/shared_display_edge_indicator.h" +#include "ash/root_window_controller.h" #include "ash/screen_util.h" #include "ash/shell.h" #include "ash/wm/coordinate_conversion.h" @@ -75,8 +76,16 @@ void MouseCursorEventFilter::HideSharedEdgeIndicator() { } void MouseCursorEventFilter::OnMouseEvent(ui::MouseEvent* event) { + aura::Window* target = static_cast<aura::Window*>(event->target()); + RootWindowController* rwc = GetRootWindowController(target->GetRootWindow()); + // The root window controller is removed during the shutting down + // RootWindow, so don't process events futher. + if (!rwc) { + event->StopPropagation(); + return; + } + if (event->type() == ui::ET_MOUSE_PRESSED) { - aura::Window* target = static_cast<aura::Window*>(event->target()); scale_when_drag_started_ = ui::GetDeviceScaleFactor(target->layer()); } else if (event->type() == ui::ET_MOUSE_RELEASED) { scale_when_drag_started_ = 1.0f; @@ -96,7 +105,6 @@ void MouseCursorEventFilter::OnMouseEvent(ui::MouseEvent* event) { } gfx::Point point_in_screen(event->location()); - aura::Window* target = static_cast<aura::Window*>(event->target()); wm::ConvertPointToScreen(target, &point_in_screen); if (WarpMouseCursorIfNecessary(target->GetRootWindow(), point_in_screen)) event->StopPropagation(); diff --git a/ash/display/screen_ash.cc b/ash/display/screen_ash.cc index 9bdb920..182557b 100644 --- a/ash/display/screen_ash.cc +++ b/ash/display/screen_ash.cc @@ -232,7 +232,11 @@ gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const { const aura::Window* root_window = window->GetRootWindow(); if (!root_window) return GetPrimaryDisplay(); - int64 id = internal::GetRootWindowSettings(root_window)->display_id; + const internal::RootWindowSettings* rws = + internal::GetRootWindowSettings(root_window); + if (rws->shutdown) + return gfx::Display(); + int64 id = rws->display_id; // if id is |kInvaildDisplayID|, it's being deleted. DCHECK(id != gfx::Display::kInvalidDisplayID); |