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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 6685069: Disambiguate OnMouseCaptureLost from OnMouseReleased, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments, fix tests, cleanup, etc. Created 9 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
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());
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.h ('k') | chrome/browser/ui/views/location_bar/location_icon_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698