Index: views/widget/root_view.cc |
diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc |
index f5ceffe67b5de8659271ef81afbd013cbb68c282..25e71e7cccab143555f438d4c1984325ff8a0228 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,24 @@ 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() { |
+ // Synthesize a release event for UpdateCursor. |
+ MouseEvent release_event(ui::ET_MOUSE_RELEASED, last_mouse_event_x_, |
+ last_mouse_event_y_, last_mouse_event_flags_); |
+ UpdateCursor(MouseEvent(release_event, this)); |
sadrul
2011/03/19 09:15:30
The purpose of MouseEvent(event, RootView*) is to
msw
2011/03/26 00:09:50
Done.
|
+ |
+ 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. |
} |
} |