Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Unified Diff: ash/display/mouse_cursor_event_filter.cc

Issue 196573023: Remove PrepareForShutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apps/shell/browser/shell_browser_main_parts.cc ('k') | ash/display/screen_ash.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/mouse_cursor_event_filter.cc
diff --git a/ash/display/mouse_cursor_event_filter.cc b/ash/display/mouse_cursor_event_filter.cc
index 3710d73c94af21dc1f352249c597dbc1d36ec99f..a91fc645a1301bb1d83e3f6ad53c32f6fff5e747 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();
« no previous file with comments | « apps/shell/browser/shell_browser_main_parts.cc ('k') | ash/display/screen_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698