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

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

Issue 1232003009: Implement DragEvent and move MouseEvent.dataTransfer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix plugin failure of LayoutTest Created 5 years, 4 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/events/WheelEvent.cpp ('k') | Source/core/page/ContextMenuControllerTest.cpp » ('j') | 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 22 matching lines...) Expand all
33 #include "core/InputTypeNames.h" 33 #include "core/InputTypeNames.h"
34 #include "core/clipboard/DataObject.h" 34 #include "core/clipboard/DataObject.h"
35 #include "core/clipboard/DataTransfer.h" 35 #include "core/clipboard/DataTransfer.h"
36 #include "core/dom/Document.h" 36 #include "core/dom/Document.h"
37 #include "core/dom/TouchList.h" 37 #include "core/dom/TouchList.h"
38 #include "core/dom/shadow/ComposedTreeTraversal.h" 38 #include "core/dom/shadow/ComposedTreeTraversal.h"
39 #include "core/dom/shadow/ShadowRoot.h" 39 #include "core/dom/shadow/ShadowRoot.h"
40 #include "core/editing/Editor.h" 40 #include "core/editing/Editor.h"
41 #include "core/editing/FrameSelection.h" 41 #include "core/editing/FrameSelection.h"
42 #include "core/editing/SelectionController.h" 42 #include "core/editing/SelectionController.h"
43 #include "core/events/DragEvent.h"
43 #include "core/events/EventPath.h" 44 #include "core/events/EventPath.h"
44 #include "core/events/KeyboardEvent.h" 45 #include "core/events/KeyboardEvent.h"
45 #include "core/events/MouseEvent.h" 46 #include "core/events/MouseEvent.h"
46 #include "core/events/PointerEvent.h" 47 #include "core/events/PointerEvent.h"
47 #include "core/events/TextEvent.h" 48 #include "core/events/TextEvent.h"
48 #include "core/events/TouchEvent.h" 49 #include "core/events/TouchEvent.h"
49 #include "core/events/WheelEvent.h" 50 #include "core/events/WheelEvent.h"
50 #include "core/fetch/ImageResource.h" 51 #include "core/fetch/ImageResource.h"
51 #include "core/frame/EventHandlerRegistry.h" 52 #include "core/frame/EventHandlerRegistry.h"
52 #include "core/frame/FrameHost.h" 53 #include "core/frame/FrameHost.h"
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 } 1272 }
1272 1273
1273 bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Node* dragTa rget, const PlatformMouseEvent& event, DataTransfer* dataTransfer) 1274 bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Node* dragTa rget, const PlatformMouseEvent& event, DataTransfer* dataTransfer)
1274 { 1275 {
1275 FrameView* view = m_frame->view(); 1276 FrameView* view = m_frame->view();
1276 1277
1277 // FIXME: We might want to dispatch a dragleave even if the view is gone. 1278 // FIXME: We might want to dispatch a dragleave even if the view is gone.
1278 if (!view) 1279 if (!view)
1279 return false; 1280 return false;
1280 1281
1281 RefPtrWillBeRawPtr<MouseEvent> me = MouseEvent::create(eventType, 1282 RefPtrWillBeRawPtr<DragEvent> me = DragEvent::create(eventType,
1282 true, true, m_frame->document()->domWindow(), 1283 true, true, m_frame->document()->domWindow(),
1283 0, event.globalPosition().x(), event.globalPosition().y(), event.positio n().x(), event.position().y(), 1284 0, event.globalPosition().x(), event.globalPosition().y(), event.positio n().x(), event.position().y(),
1284 event.movementDelta().x(), event.movementDelta().y(), 1285 event.movementDelta().x(), event.movementDelta().y(),
1285 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 1286 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(),
1286 0, MouseEvent::platformModifiersToButtons(event.modifiers()), nullptr, d ataTransfer, false, event.syntheticEventType(), event.timestamp()); 1287 0, MouseEvent::platformModifiersToButtons(event.modifiers()), nullptr, d ataTransfer, false, event.syntheticEventType(), event.timestamp());
1287 1288
1288 dragTarget->dispatchEvent(me.get()); 1289 dragTarget->dispatchEvent(me.get());
1289 return me->defaultPrevented(); 1290 return me->defaultPrevented();
1290 } 1291 }
1291 1292
(...skipping 2703 matching lines...) Expand 10 before | Expand all | Expand 10 after
3995 unsigned EventHandler::accessKeyModifiers() 3996 unsigned EventHandler::accessKeyModifiers()
3996 { 3997 {
3997 #if OS(MACOSX) 3998 #if OS(MACOSX)
3998 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3999 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3999 #else 4000 #else
4000 return PlatformEvent::AltKey; 4001 return PlatformEvent::AltKey;
4001 #endif 4002 #endif
4002 } 4003 }
4003 4004
4004 } // namespace blink 4005 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/events/WheelEvent.cpp ('k') | Source/core/page/ContextMenuControllerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698