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

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

Issue 189573002: Convert HTMLFrameOwnerElement and FocusController to use Frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Improved downcast checking. Created 6 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
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 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 // There is something of a webcompat angle to this well, as highlighted by 1707 // There is something of a webcompat angle to this well, as highlighted by
1708 // crbug.com/14608. Pages can clear text boxes 'onclick' and, if we paste on 1708 // crbug.com/14608. Pages can clear text boxes 'onclick' and, if we paste on
1709 // down then the text is pasted just before the onclick handler runs and 1709 // down then the text is pasted just before the onclick handler runs and
1710 // clears the text box. So it's important this happens after the event 1710 // clears the text box. So it's important this happens after the event
1711 // handlers have been fired. 1711 // handlers have been fired.
1712 if (mouseEvent.type() != PlatformEvent::MouseReleased) 1712 if (mouseEvent.type() != PlatformEvent::MouseReleased)
1713 return false; 1713 return false;
1714 1714
1715 if (!m_frame->page()) 1715 if (!m_frame->page())
1716 return false; 1716 return false;
1717 LocalFrame* focusFrame = m_frame->page()->focusController().focusedOrMainFra me(); 1717 Frame* focusFrame = m_frame->page()->focusController().focusedOrMainFrame();
1718 // Do not paste here if the focus was moved somewhere else. 1718 // Do not paste here if the focus was moved somewhere else.
1719 if (m_frame == focusFrame && m_frame->editor().behavior().supportsGlobalSele ction()) 1719 if (m_frame == focusFrame && m_frame->editor().behavior().supportsGlobalSele ction())
1720 return m_frame->editor().command("PasteGlobalSelection").execute(); 1720 return m_frame->editor().command("PasteGlobalSelection").execute();
1721 1721
1722 return false; 1722 return false;
1723 } 1723 }
1724 1724
1725 1725
1726 bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Node* dragTa rget, const PlatformMouseEvent& event, Clipboard* clipboard) 1726 bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Node* dragTa rget, const PlatformMouseEvent& event, Clipboard* clipboard)
1727 { 1727 {
(...skipping 15 matching lines...) Expand all
1743 } 1743 }
1744 1744
1745 static bool targetIsFrame(Node* target, LocalFrame*& frame) 1745 static bool targetIsFrame(Node* target, LocalFrame*& frame)
1746 { 1746 {
1747 if (!target) 1747 if (!target)
1748 return false; 1748 return false;
1749 1749
1750 if (!target->hasTagName(frameTag) && !target->hasTagName(iframeTag)) 1750 if (!target->hasTagName(frameTag) && !target->hasTagName(iframeTag))
1751 return false; 1751 return false;
1752 1752
1753 frame = toHTMLFrameElementBase(target)->contentFrame(); 1753 // Cross-process drag and drop is not yet supported.
dcheng 2014/03/17 18:17:44 Tag this with FIXME? Maybe we should track these i
kenrb 2014/03/18 20:01:19 I'm not worried about that in cases where we will
1754 if (!toHTMLFrameElementBase(target)->contentFrame()->isLocalFrame())
1755 return false;
1756
1757 frame = toLocalFrame(toHTMLFrameElementBase(target)->contentFrame());
1754 return true; 1758 return true;
1755 } 1759 }
1756 1760
1757 static bool findDropZone(Node* target, Clipboard* clipboard) 1761 static bool findDropZone(Node* target, Clipboard* clipboard)
1758 { 1762 {
1759 Element* element = target->isElementNode() ? toElement(target) : target->par entElement(); 1763 Element* element = target->isElementNode() ? toElement(target) : target->par entElement();
1760 for (; element; element = element->parentElement()) { 1764 for (; element; element = element->parentElement()) {
1761 bool matched = false; 1765 bool matched = false;
1762 AtomicString dropZoneStr = element->fastGetAttribute(webkitdropzoneAttr) ; 1766 AtomicString dropZoneStr = element->fastGetAttribute(webkitdropzoneAttr) ;
1763 1767
(...skipping 2262 matching lines...) Expand 10 before | Expand all | Expand 10 after
4026 unsigned EventHandler::accessKeyModifiers() 4030 unsigned EventHandler::accessKeyModifiers()
4027 { 4031 {
4028 #if OS(MACOSX) 4032 #if OS(MACOSX)
4029 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 4033 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
4030 #else 4034 #else
4031 return PlatformEvent::AltKey; 4035 return PlatformEvent::AltKey;
4032 #endif 4036 #endif
4033 } 4037 }
4034 4038
4035 } // namespace WebCore 4039 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698