Index: views/widget/root_view.cc |
diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc |
index f5ceffe67b5de8659271ef81afbd013cbb68c282..b5fe629fb1dfd812de1cc89c1a72f19014e709db 100644 |
--- a/views/widget/root_view.cc |
+++ b/views/widget/root_view.cc |
@@ -82,15 +82,6 @@ void RootView::NotifyNativeViewHierarchyChanged(bool attached, |
// Input ----------------------------------------------------------------------- |
-void RootView::ProcessMouseDragCanceled() { |
- if (mouse_pressed_handler_) { |
- // Synthesize a release event. |
- MouseEvent release_event(ui::ET_MOUSE_RELEASED, last_mouse_event_x_, |
- last_mouse_event_y_, last_mouse_event_flags_); |
- OnMouseReleased(release_event, true); |
- } |
-} |
- |
bool RootView::ProcessKeyEvent(const KeyEvent& event) { |
bool consumed = false; |
@@ -261,7 +252,7 @@ bool RootView::OnMouseDragged(const MouseEvent& event) { |
return false; |
} |
-void RootView::OnMouseReleased(const MouseEvent& event, bool canceled) { |
+void RootView::OnMouseReleased(const MouseEvent& event) { |
MouseEvent e(event, this); |
UpdateCursor(e); |
@@ -274,7 +265,20 @@ void RootView::OnMouseReleased(const MouseEvent& event, bool canceled) { |
View* mouse_pressed_handler = mouse_pressed_handler_; |
mouse_pressed_handler_ = NULL; |
explicit_mouse_handler_ = false; |
- mouse_pressed_handler->ProcessMouseReleased(mouse_released, canceled); |
+ mouse_pressed_handler->ProcessMouseReleased(mouse_released); |
+ // WARNING: we may have been deleted. |
+ } |
+} |
+ |
+void RootView::OnMouseCaptureLost() { |
+ // TODO(msw): Call UpdateCursor with a synthesized event? |
+ if (mouse_pressed_handler_) { |
+ // We allow the view to delete us from ProcessMouseReleased. As such, |
+ // configure state such that we're done first, then call View. |
+ View* mouse_pressed_handler = mouse_pressed_handler_; |
+ mouse_pressed_handler_ = NULL; |
+ explicit_mouse_handler_ = false; |
+ mouse_pressed_handler->OnMouseCaptureLost(); |
// WARNING: we may have been deleted. |
} |
} |