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

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

Issue 23060022: Don't turn middleclicks into click events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Going back to simple fix: No click events. Done. Created 7 years, 2 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 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 return true; 1675 return true;
1676 1676
1677 bool swallowMouseUpEvent = !dispatchMouseEvent(EventNames::mouseup, mev.targ etNode(), true, m_clickCount, mouseEvent, false); 1677 bool swallowMouseUpEvent = !dispatchMouseEvent(EventNames::mouseup, mev.targ etNode(), true, m_clickCount, mouseEvent, false);
1678 1678
1679 bool contextMenuEvent = mouseEvent.button() == RightButton; 1679 bool contextMenuEvent = mouseEvent.button() == RightButton;
1680 #if OS(MACOSX) 1680 #if OS(MACOSX)
1681 // FIXME: The Mac port achieves the same behavior by checking whether the co ntext menu is currently open in WebPage::mouseEvent(). Consider merging the impl ementations. 1681 // FIXME: The Mac port achieves the same behavior by checking whether the co ntext menu is currently open in WebPage::mouseEvent(). Consider merging the impl ementations.
1682 if (mouseEvent.button() == LeftButton && mouseEvent.modifiers() & PlatformEv ent::CtrlKey) 1682 if (mouseEvent.button() == LeftButton && mouseEvent.modifiers() & PlatformEv ent::CtrlKey)
1683 contextMenuEvent = true; 1683 contextMenuEvent = true;
1684 #endif 1684 #endif
1685 1685 bool swallowClickEvent = false;
1686 bool swallowClickEvent = m_clickCount > 0 && !contextMenuEvent && mouseIsRel easedOnPressedElement(mev.targetNode(), m_clickNode.get()) && !dispatchMouseEven t(EventNames::click, mev.targetNode(), true, m_clickCount, mouseEvent, true); 1686 if (m_clickCount > 0 && !contextMenuEvent && mouseEvent.button() != MiddleBu tton && mouseIsReleasedOnPressedElement(mev.targetNode(), m_clickNode.get())) {
1687 // Turn the Mouse Button Released event into a click event since all req uirements are fulfilled.
1688 swallowClickEvent = !dispatchMouseEvent(EventNames::click, mev.targetNod e(), true, m_clickCount, mouseEvent, true);
1689 }
1687 1690
1688 if (m_resizeLayer) { 1691 if (m_resizeLayer) {
1689 m_resizeLayer->setInResizeMode(false); 1692 m_resizeLayer->setInResizeMode(false);
1690 m_resizeLayer = 0; 1693 m_resizeLayer = 0;
1691 } 1694 }
1692 1695
1693 bool swallowMouseReleaseEvent = false; 1696 bool swallowMouseReleaseEvent = false;
1694 if (!swallowMouseUpEvent) 1697 if (!swallowMouseUpEvent)
1695 swallowMouseReleaseEvent = handleMouseReleaseEvent(mev); 1698 swallowMouseReleaseEvent = handleMouseReleaseEvent(mev);
1696 1699
(...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after
3869 unsigned EventHandler::accessKeyModifiers() 3872 unsigned EventHandler::accessKeyModifiers()
3870 { 3873 {
3871 #if OS(MACOSX) 3874 #if OS(MACOSX)
3872 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3875 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3873 #else 3876 #else
3874 return PlatformEvent::AltKey; 3877 return PlatformEvent::AltKey;
3875 #endif 3878 #endif
3876 } 3879 }
3877 3880
3878 } // namespace WebCore 3881 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698