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

Side by Side Diff: Source/core/page/EventHandler.cpp

Issue 339123003: Minor cleanup in EventHandler::dragHysteresisExceeded. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: (ab)using this CL to remove an invalid comment. Created 6 years, 6 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
« no previous file with comments | « Source/core/page/DragActions.h ('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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 2993 matching lines...) Expand 10 before | Expand all | Expand 10 after
3004 } 3004 }
3005 if (event->type() == EventTypeNames::keypress) { 3005 if (event->type() == EventTypeNames::keypress) {
3006 m_frame->editor().handleKeyboardEvent(event); 3006 m_frame->editor().handleKeyboardEvent(event);
3007 if (event->defaultHandled()) 3007 if (event->defaultHandled())
3008 return; 3008 return;
3009 if (event->charCode() == ' ') 3009 if (event->charCode() == ' ')
3010 defaultSpaceEventHandler(event); 3010 defaultSpaceEventHandler(event);
3011 } 3011 }
3012 } 3012 }
3013 3013
3014 bool EventHandler::dragHysteresisExceeded(const IntPoint& floatDragViewportLocat ion) const 3014 bool EventHandler::dragHysteresisExceeded(const FloatPoint& floatDragViewportLoc ation) const
3015 { 3015 {
3016 FloatPoint dragViewportLocation(floatDragViewportLocation.x(), floatDragView portLocation.y()); 3016 return dragHysteresisExceeded(flooredIntPoint(floatDragViewportLocation));
3017 return dragHysteresisExceeded(dragViewportLocation);
3018 } 3017 }
3019 3018
3020 bool EventHandler::dragHysteresisExceeded(const FloatPoint& dragViewportLocation ) const 3019 bool EventHandler::dragHysteresisExceeded(const IntPoint& dragViewportLocation) const
3021 { 3020 {
3022 FrameView* view = m_frame->view(); 3021 FrameView* view = m_frame->view();
3023 if (!view) 3022 if (!view)
3024 return false; 3023 return false;
3025 IntPoint dragLocation = view->windowToContents(flooredIntPoint(dragViewportL ocation)); 3024 IntPoint dragLocation = view->windowToContents(dragViewportLocation);
3026 IntSize delta = dragLocation - m_mouseDownPos; 3025 IntSize delta = dragLocation - m_mouseDownPos;
3027 3026
3028 int threshold = GeneralDragHysteresis; 3027 int threshold = GeneralDragHysteresis;
3029 switch (dragState().m_dragType) { 3028 switch (dragState().m_dragType) {
3030 case DragSourceActionSelection: 3029 case DragSourceActionSelection:
3031 threshold = TextDragHysteresis; 3030 threshold = TextDragHysteresis;
3032 break; 3031 break;
3033 case DragSourceActionImage: 3032 case DragSourceActionImage:
3034 threshold = ImageDragHysteresis; 3033 threshold = ImageDragHysteresis;
3035 break; 3034 break;
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
3764 unsigned EventHandler::accessKeyModifiers() 3763 unsigned EventHandler::accessKeyModifiers()
3765 { 3764 {
3766 #if OS(MACOSX) 3765 #if OS(MACOSX)
3767 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3766 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3768 #else 3767 #else
3769 return PlatformEvent::AltKey; 3768 return PlatformEvent::AltKey;
3770 #endif 3769 #endif
3771 } 3770 }
3772 3771
3773 } // namespace WebCore 3772 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/DragActions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698