Index: chrome/browser/ui/views/location_bar/location_bar_view.cc |
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
index 72a0034fb7dfa9b29040e025a0b94bf6fa4fbc5d..8ab84c20c727924059892ec1dd9ca674e3f1234f 100644 |
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
@@ -741,12 +741,9 @@ bool LocationBarView::OnMouseDragged(const views::MouseEvent& event) { |
return true; |
} |
-void LocationBarView::OnMouseReleased(const views::MouseEvent& event, |
- bool canceled) { |
+void LocationBarView::OnMouseReleased(const views::MouseEvent& event) { |
UINT msg; |
- if (canceled) { |
- msg = WM_CAPTURECHANGED; |
- } else if (event.IsLeftMouseButton()) { |
+ if (event.IsLeftMouseButton()) { |
msg = WM_LBUTTONUP; |
} else if (event.IsMiddleMouseButton()) { |
msg = WM_MBUTTONUP; |
@@ -758,6 +755,10 @@ void LocationBarView::OnMouseReleased(const views::MouseEvent& event, |
} |
OnMouseEvent(event, msg); |
} |
+ |
+void LocationBarView::OnMouseCaptureLost() { |
+ location_entry_->HandleExternalMsg(WM_CAPTURECHANGED, 0, CPoint()); |
+} |
#endif |
void LocationBarView::OnAutocompleteAccept( |
@@ -946,18 +947,7 @@ void LocationBarView::RefreshPageActionViews() { |
#if defined(OS_WIN) |
void LocationBarView::OnMouseEvent(const views::MouseEvent& event, UINT msg) { |
- UINT flags = 0; |
- if (event.IsControlDown()) |
- flags |= MK_CONTROL; |
- if (event.IsShiftDown()) |
- flags |= MK_SHIFT; |
- if (event.IsLeftMouseButton()) |
- flags |= MK_LBUTTON; |
- if (event.IsMiddleMouseButton()) |
- flags |= MK_MBUTTON; |
- if (event.IsRightMouseButton()) |
- flags |= MK_RBUTTON; |
- |
+ UINT flags = event.GetWindowsFlags(); |
gfx::Point screen_point(event.location()); |
ConvertPointToScreen(this, &screen_point); |
location_entry_->HandleExternalMsg(msg, flags, screen_point.ToPOINT()); |