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

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 1331533002: [poc] curve-filter Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Draw layered images with a recording GraphicContext Created 5 years 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
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 #include "core/style/ComputedStyle.h" 83 #include "core/style/ComputedStyle.h"
84 #include "core/svg/SVGDocumentExtensions.h" 84 #include "core/svg/SVGDocumentExtensions.h"
85 #include "platform/PlatformGestureEvent.h" 85 #include "platform/PlatformGestureEvent.h"
86 #include "platform/PlatformKeyboardEvent.h" 86 #include "platform/PlatformKeyboardEvent.h"
87 #include "platform/PlatformTouchEvent.h" 87 #include "platform/PlatformTouchEvent.h"
88 #include "platform/PlatformWheelEvent.h" 88 #include "platform/PlatformWheelEvent.h"
89 #include "platform/RuntimeEnabledFeatures.h" 89 #include "platform/RuntimeEnabledFeatures.h"
90 #include "platform/TraceEvent.h" 90 #include "platform/TraceEvent.h"
91 #include "platform/WindowsKeyboardCodes.h" 91 #include "platform/WindowsKeyboardCodes.h"
92 #include "platform/geometry/FloatPoint.h" 92 #include "platform/geometry/FloatPoint.h"
93 #include "platform/graphics/GraphicsScreen.h"
93 #include "platform/graphics/Image.h" 94 #include "platform/graphics/Image.h"
94 #include "platform/heap/Handle.h" 95 #include "platform/heap/Handle.h"
95 #include "platform/scroll/ScrollAnimatorBase.h" 96 #include "platform/scroll/ScrollAnimatorBase.h"
96 #include "platform/scroll/Scrollbar.h" 97 #include "platform/scroll/Scrollbar.h"
97 #include "wtf/Assertions.h" 98 #include "wtf/Assertions.h"
98 #include "wtf/CurrentTime.h" 99 #include "wtf/CurrentTime.h"
99 #include "wtf/StdLibExtras.h" 100 #include "wtf/StdLibExtras.h"
100 #include "wtf/TemporaryChange.h" 101 #include "wtf/TemporaryChange.h"
101 102
102 namespace blink { 103 namespace blink {
(...skipping 3280 matching lines...) Expand 10 before | Expand all | Expand 10 after
3383 // We are starting a text/image/url drag, so the cursor should be an arrow 3384 // We are starting a text/image/url drag, so the cursor should be an arrow
3384 // FIXME <rdar://7577595>: Custom cursors aren't supported during drag and d rop (default to pointer). 3385 // FIXME <rdar://7577595>: Custom cursors aren't supported during drag and d rop (default to pointer).
3385 m_frame->view()->setCursor(pointerCursor()); 3386 m_frame->view()->setCursor(pointerCursor());
3386 3387
3387 if (initiator == DragInitiator::Mouse && !dragHysteresisExceeded(event.event ().position())) 3388 if (initiator == DragInitiator::Mouse && !dragHysteresisExceeded(event.event ().position()))
3388 return true; 3389 return true;
3389 3390
3390 // Once we're past the hysteresis point, we don't want to treat this gesture as a click 3391 // Once we're past the hysteresis point, we don't want to treat this gesture as a click
3391 invalidateClick(); 3392 invalidateClick();
3392 3393
3394 int64_t previousId = setCurrentScreenId(reinterpret_cast<int64_t>(m_frame->p age()));
3395
3393 if (!tryStartDrag(event)) { 3396 if (!tryStartDrag(event)) {
3394 // Something failed to start the drag, clean up. 3397 // Something failed to start the drag, clean up.
3395 clearDragDataTransfer(); 3398 clearDragDataTransfer();
3396 dragState().m_dragSrc = nullptr; 3399 dragState().m_dragSrc = nullptr;
3397 } 3400 }
3398 3401
3402 setCurrentScreenId(previousId);
3403
3399 m_mouseDownMayStartDrag = false; 3404 m_mouseDownMayStartDrag = false;
3400 // Whether or not the drag actually started, no more default handling (like selection). 3405 // Whether or not the drag actually started, no more default handling (like selection).
3401 return true; 3406 return true;
3402 } 3407 }
3403 3408
3404 bool EventHandler::tryStartDrag(const MouseEventWithHitTestResults& event) 3409 bool EventHandler::tryStartDrag(const MouseEventWithHitTestResults& event)
3405 { 3410 {
3406 // The DataTransfer would only be non-empty if we missed a dragEnd. 3411 // The DataTransfer would only be non-empty if we missed a dragEnd.
3407 // Clear it anyway, just to make sure it gets numbified. 3412 // Clear it anyway, just to make sure it gets numbified.
3408 clearDragDataTransfer(); 3413 clearDragDataTransfer();
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
4088 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() 4093 PlatformEvent::Modifiers EventHandler::accessKeyModifiers()
4089 { 4094 {
4090 #if OS(MACOSX) 4095 #if OS(MACOSX)
4091 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey); 4096 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey);
4092 #else 4097 #else
4093 return PlatformEvent::AltKey; 4098 return PlatformEvent::AltKey;
4094 #endif 4099 #endif
4095 } 4100 }
4096 4101
4097 } // namespace blink 4102 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698