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

Side by Side Diff: views/widget/widget_win.cc

Issue 6685069: Disambiguate OnMouseCaptureLost from OnMouseReleased, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address most TODOs and sync. 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 unified diff | Download patch | Annotate | Revision Log
« views/widget/widget_gtk.h ('K') | « views/widget/widget_gtk.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "views/widget/widget_win.h" 5 #include "views/widget/widget_win.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/win/windows_version.h" 10 #include "base/win/windows_version.h"
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 int keystate) { 507 int keystate) {
508 SetMsgHandled(FALSE); 508 SetMsgHandled(FALSE);
509 return 0; 509 return 0;
510 } 510 }
511 511
512 void WidgetWin::OnCancelMode() { 512 void WidgetWin::OnCancelMode() {
513 } 513 }
514 514
515 void WidgetWin::OnCaptureChanged(HWND hwnd) { 515 void WidgetWin::OnCaptureChanged(HWND hwnd) {
516 if (is_mouse_down_) 516 if (is_mouse_down_)
517 GetRootView()->ProcessMouseDragCanceled(); 517 GetRootView()->OnMouseCaptureLost();
518 is_mouse_down_ = false; 518 is_mouse_down_ = false;
519 } 519 }
520 520
521 void WidgetWin::OnClose() { 521 void WidgetWin::OnClose() {
522 Close(); 522 Close();
523 } 523 }
524 524
525 void WidgetWin::OnCommand(UINT notification_code, int command_id, HWND window) { 525 void WidgetWin::OnCommand(UINT notification_code, int command_id, HWND window) {
526 SetMsgHandled(FALSE); 526 SetMsgHandled(FALSE);
527 } 527 }
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 is_mouse_down_ = false; 962 is_mouse_down_ = false;
963 963
964 // Release the capture first, that way we don't get confused if 964 // Release the capture first, that way we don't get confused if
965 // OnMouseReleased blocks. 965 // OnMouseReleased blocks.
966 if (HasNativeCapture() && ReleaseCaptureOnMouseReleased()) 966 if (HasNativeCapture() && ReleaseCaptureOnMouseReleased())
967 ReleaseNativeCapture(); 967 ReleaseNativeCapture();
968 968
969 MSG msg; 969 MSG msg;
970 MakeMSG(&msg, message, w_param, l_param, 0, GET_X_LPARAM(l_param), 970 MakeMSG(&msg, message, w_param, l_param, 0, GET_X_LPARAM(l_param),
971 GET_Y_LPARAM(l_param)); 971 GET_Y_LPARAM(l_param));
972 GetRootView()->OnMouseReleased(MouseEvent(msg), false); 972 GetRootView()->OnMouseReleased(MouseEvent(msg));
973 return true; 973 return true;
974 } 974 }
975 975
976 bool WidgetWin::ProcessMouseMoved(UINT message, 976 bool WidgetWin::ProcessMouseMoved(UINT message,
977 WPARAM w_param, 977 WPARAM w_param,
978 LPARAM l_param) { 978 LPARAM l_param) {
979 // Windows only fires WM_MOUSELEAVE events if the application begins 979 // Windows only fires WM_MOUSELEAVE events if the application begins
980 // "tracking" mouse events for a given HWND during WM_MOUSEMOVE events. 980 // "tracking" mouse events for a given HWND during WM_MOUSEMOVE events.
981 // We need to call |TrackMouseEvents| to listen for WM_MOUSELEAVE. 981 // We need to call |TrackMouseEvents| to listen for WM_MOUSELEAVE.
982 if (!HasNativeCapture()) 982 if (!HasNativeCapture())
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 return; 1220 return;
1221 1221
1222 NativeWidget* native_widget = GetNativeWidgetForNativeView(native_view); 1222 NativeWidget* native_widget = GetNativeWidgetForNativeView(native_view);
1223 if (native_widget) 1223 if (native_widget)
1224 children->insert(native_widget); 1224 children->insert(native_widget);
1225 EnumChildWindows(native_view, EnumerateChildWindowsForNativeWidgets, 1225 EnumChildWindows(native_view, EnumerateChildWindowsForNativeWidgets,
1226 reinterpret_cast<LPARAM>(children)); 1226 reinterpret_cast<LPARAM>(children));
1227 } 1227 }
1228 1228
1229 } // namespace views 1229 } // namespace views
OLDNEW
« views/widget/widget_gtk.h ('K') | « views/widget/widget_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698