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

Side by Side Diff: Source/WebCore/page/DOMWindow.cpp

Issue 11644048: Revert 138209 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 8 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
« no previous file with comments | « Source/WebCore/html/HTMLInputElement.cpp ('k') | Source/WebCore/page/EventHandler.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, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 bool DOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<Event Listener> listener, bool useCapture) 1575 bool DOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<Event Listener> listener, bool useCapture)
1576 { 1576 {
1577 if (!EventTarget::addEventListener(eventType, listener, useCapture)) 1577 if (!EventTarget::addEventListener(eventType, listener, useCapture))
1578 return false; 1578 return false;
1579 1579
1580 if (Document* document = this->document()) { 1580 if (Document* document = this->document()) {
1581 document->addListenerTypeIfNeeded(eventType); 1581 document->addListenerTypeIfNeeded(eventType);
1582 if (eventType == eventNames().mousewheelEvent) 1582 if (eventType == eventNames().mousewheelEvent)
1583 document->didAddWheelEventHandler(); 1583 document->didAddWheelEventHandler();
1584 else if (eventNames().isTouchEventType(eventType)) 1584 else if (eventNames().isTouchEventType(eventType))
1585 document->didAddTouchEventHandler(); 1585 document->didAddTouchEventHandler(document);
1586 else if (eventType == eventNames().storageEvent) 1586 else if (eventType == eventNames().storageEvent)
1587 didAddStorageEventListener(this); 1587 didAddStorageEventListener(this);
1588 } 1588 }
1589 1589
1590 if (eventType == eventNames().unloadEvent) 1590 if (eventType == eventNames().unloadEvent)
1591 addUnloadEventListener(this); 1591 addUnloadEventListener(this);
1592 else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadLi steners(this)) 1592 else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadLi steners(this))
1593 addBeforeUnloadEventListener(this); 1593 addBeforeUnloadEventListener(this);
1594 #if ENABLE(DEVICE_ORIENTATION) 1594 #if ENABLE(DEVICE_ORIENTATION)
1595 else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatur es::deviceMotionEnabled()) { 1595 else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatur es::deviceMotionEnabled()) {
(...skipping 10 matching lines...) Expand all
1606 1606
1607 bool DOMWindow::removeEventListener(const AtomicString& eventType, EventListener * listener, bool useCapture) 1607 bool DOMWindow::removeEventListener(const AtomicString& eventType, EventListener * listener, bool useCapture)
1608 { 1608 {
1609 if (!EventTarget::removeEventListener(eventType, listener, useCapture)) 1609 if (!EventTarget::removeEventListener(eventType, listener, useCapture))
1610 return false; 1610 return false;
1611 1611
1612 if (Document* document = this->document()) { 1612 if (Document* document = this->document()) {
1613 if (eventType == eventNames().mousewheelEvent) 1613 if (eventType == eventNames().mousewheelEvent)
1614 document->didRemoveWheelEventHandler(); 1614 document->didRemoveWheelEventHandler();
1615 else if (eventNames().isTouchEventType(eventType)) 1615 else if (eventNames().isTouchEventType(eventType))
1616 document->didRemoveTouchEventHandler(); 1616 document->didRemoveTouchEventHandler(document);
1617 } 1617 }
1618 1618
1619 if (eventType == eventNames().unloadEvent) 1619 if (eventType == eventNames().unloadEvent)
1620 removeUnloadEventListener(this); 1620 removeUnloadEventListener(this);
1621 else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadLi steners(this)) 1621 else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadLi steners(this))
1622 removeBeforeUnloadEventListener(this); 1622 removeBeforeUnloadEventListener(this);
1623 #if ENABLE(DEVICE_ORIENTATION) 1623 #if ENABLE(DEVICE_ORIENTATION)
1624 else if (eventType == eventNames().devicemotionEvent) { 1624 else if (eventType == eventNames().devicemotionEvent) {
1625 if (DeviceMotionController* controller = DeviceMotionController::from(pa ge())) 1625 if (DeviceMotionController* controller = DeviceMotionController::from(pa ge()))
1626 controller->removeDeviceEventListener(this); 1626 controller->removeDeviceEventListener(this);
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
1940 WindowFeatures windowFeatures(dialogFeaturesString, screenAvailableRect(m_fr ame->view())); 1940 WindowFeatures windowFeatures(dialogFeaturesString, screenAvailableRect(m_fr ame->view()));
1941 Frame* dialogFrame = createWindow(urlString, emptyAtom, windowFeatures, 1941 Frame* dialogFrame = createWindow(urlString, emptyAtom, windowFeatures,
1942 activeWindow, firstFrame, m_frame, function, functionContext); 1942 activeWindow, firstFrame, m_frame, function, functionContext);
1943 if (!dialogFrame) 1943 if (!dialogFrame)
1944 return; 1944 return;
1945 1945
1946 dialogFrame->page()->chrome()->runModal(); 1946 dialogFrame->page()->chrome()->runModal();
1947 } 1947 }
1948 1948
1949 } // namespace WebCore 1949 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/html/HTMLInputElement.cpp ('k') | Source/WebCore/page/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698