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

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

Issue 879333002: Support buttons attribute for drag event (blink side). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 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
« no previous file with comments | « Source/core/page/DragData.cpp ('k') | Source/web/WebInputEventConversion.h » ('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 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 1639
1640 1640
1641 bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Node* dragTa rget, const PlatformMouseEvent& event, DataTransfer* dataTransfer) 1641 bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Node* dragTa rget, const PlatformMouseEvent& event, DataTransfer* dataTransfer)
1642 { 1642 {
1643 FrameView* view = m_frame->view(); 1643 FrameView* view = m_frame->view();
1644 1644
1645 // FIXME: We might want to dispatch a dragleave even if the view is gone. 1645 // FIXME: We might want to dispatch a dragleave even if the view is gone.
1646 if (!view) 1646 if (!view)
1647 return false; 1647 return false;
1648 1648
1649 // FIXME: The drag event have to support for |buttons| attribute because
1650 // the event is derived from mouse event. Please see crbug.com/276941.
1651 RefPtrWillBeRawPtr<MouseEvent> me = MouseEvent::create(eventType, 1649 RefPtrWillBeRawPtr<MouseEvent> me = MouseEvent::create(eventType,
1652 true, true, m_frame->document()->domWindow(), 1650 true, true, m_frame->document()->domWindow(),
1653 0, event.globalPosition().x(), event.globalPosition().y(), event.positio n().x(), event.position().y(), 1651 0, event.globalPosition().x(), event.globalPosition().y(), event.positio n().x(), event.position().y(),
1654 event.movementDelta().x(), event.movementDelta().y(), 1652 event.movementDelta().x(), event.movementDelta().y(),
1655 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 1653 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(),
1656 0, 0, nullptr, dataTransfer); 1654 0, MouseEvent::platformModifiersToButtons(event.modifiers()), nullptr, d ataTransfer);
1657 1655
1658 dragTarget->dispatchEvent(me.get(), IGNORE_EXCEPTION); 1656 dragTarget->dispatchEvent(me.get(), IGNORE_EXCEPTION);
1659 return me->defaultPrevented(); 1657 return me->defaultPrevented();
1660 } 1658 }
1661 1659
1662 static bool targetIsFrame(Node* target, LocalFrame*& frame) 1660 static bool targetIsFrame(Node* target, LocalFrame*& frame)
1663 { 1661 {
1664 if (!isHTMLFrameElementBase(target)) 1662 if (!isHTMLFrameElementBase(target))
1665 return false; 1663 return false;
1666 1664
(...skipping 2252 matching lines...) Expand 10 before | Expand all | Expand 10 after
3919 3917
3920 // If it's in the direction to hide the top controls, only consume when the frame can also scroll. 3918 // If it's in the direction to hide the top controls, only consume when the frame can also scroll.
3921 if (m_frame->view()->scrollPosition().y() < m_frame->view()->maximumScrollPo sition().y()) 3919 if (m_frame->view()->scrollPosition().y() < m_frame->view()->maximumScrollPo sition().y())
3922 return true; 3920 return true;
3923 3921
3924 return false; 3922 return false;
3925 } 3923 }
3926 3924
3927 3925
3928 } // namespace blink 3926 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/DragData.cpp ('k') | Source/web/WebInputEventConversion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698