OLD | NEW |
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 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1530 document->didAddTouchEventHandler(document); | 1530 document->didAddTouchEventHandler(document); |
1531 else if (eventType == eventNames().storageEvent) | 1531 else if (eventType == eventNames().storageEvent) |
1532 didAddStorageEventListener(this); | 1532 didAddStorageEventListener(this); |
1533 } | 1533 } |
1534 | 1534 |
1535 if (eventType == eventNames().unloadEvent) | 1535 if (eventType == eventNames().unloadEvent) |
1536 addUnloadEventListener(this); | 1536 addUnloadEventListener(this); |
1537 else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadLi
steners(this)) | 1537 else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadLi
steners(this)) |
1538 addBeforeUnloadEventListener(this); | 1538 addBeforeUnloadEventListener(this); |
1539 else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatur
es::deviceMotionEnabled()) { | 1539 else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatur
es::deviceMotionEnabled()) { |
1540 if (DeviceMotionController* controller = DeviceMotionController::from(pa
ge())) | 1540 if (DeviceMotionController* controller = DeviceMotionController::from(do
cument())) |
1541 controller->addDeviceEventListener(this); | 1541 controller->startUpdating(); |
1542 } else if (eventType == eventNames().deviceorientationEvent && RuntimeEnable
dFeatures::deviceOrientationEnabled()) { | 1542 } else if (eventType == eventNames().deviceorientationEvent && RuntimeEnable
dFeatures::deviceOrientationEnabled()) { |
1543 if (DeviceOrientationController* controller = DeviceOrientationControlle
r::from(page())) | 1543 if (DeviceOrientationController* controller = DeviceOrientationControlle
r::from(page())) |
1544 controller->addDeviceEventListener(this); | 1544 controller->addDeviceEventListener(this); |
1545 } | 1545 } |
1546 | 1546 |
1547 return true; | 1547 return true; |
1548 } | 1548 } |
1549 | 1549 |
1550 bool DOMWindow::removeEventListener(const AtomicString& eventType, EventListener
* listener, bool useCapture) | 1550 bool DOMWindow::removeEventListener(const AtomicString& eventType, EventListener
* listener, bool useCapture) |
1551 { | 1551 { |
1552 if (!EventTarget::removeEventListener(eventType, listener, useCapture)) | 1552 if (!EventTarget::removeEventListener(eventType, listener, useCapture)) |
1553 return false; | 1553 return false; |
1554 | 1554 |
1555 if (Document* document = this->document()) { | 1555 if (Document* document = this->document()) { |
1556 if (eventType == eventNames().mousewheelEvent) | 1556 if (eventType == eventNames().mousewheelEvent) |
1557 document->didRemoveWheelEventHandler(); | 1557 document->didRemoveWheelEventHandler(); |
1558 else if (eventNames().isTouchEventType(eventType)) | 1558 else if (eventNames().isTouchEventType(eventType)) |
1559 document->didRemoveTouchEventHandler(document); | 1559 document->didRemoveTouchEventHandler(document); |
1560 } | 1560 } |
1561 | 1561 |
1562 if (eventType == eventNames().unloadEvent) | 1562 if (eventType == eventNames().unloadEvent) |
1563 removeUnloadEventListener(this); | 1563 removeUnloadEventListener(this); |
1564 else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadLi
steners(this)) | 1564 else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadLi
steners(this)) |
1565 removeBeforeUnloadEventListener(this); | 1565 removeBeforeUnloadEventListener(this); |
1566 else if (eventType == eventNames().devicemotionEvent) { | 1566 else if (eventType == eventNames().devicemotionEvent) { |
1567 if (DeviceMotionController* controller = DeviceMotionController::from(pa
ge())) | 1567 if (DeviceMotionController* controller = DeviceMotionController::from(do
cument())) |
1568 controller->removeDeviceEventListener(this); | 1568 controller->stopUpdating(); |
1569 } else if (eventType == eventNames().deviceorientationEvent) { | 1569 } else if (eventType == eventNames().deviceorientationEvent) { |
1570 if (DeviceOrientationController* controller = DeviceOrientationControlle
r::from(page())) | 1570 if (DeviceOrientationController* controller = DeviceOrientationControlle
r::from(page())) |
1571 controller->removeDeviceEventListener(this); | 1571 controller->removeDeviceEventListener(this); |
1572 } | 1572 } |
1573 | 1573 |
1574 return true; | 1574 return true; |
1575 } | 1575 } |
1576 | 1576 |
1577 void DOMWindow::dispatchLoadEvent() | 1577 void DOMWindow::dispatchLoadEvent() |
1578 { | 1578 { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1613 | 1613 |
1614 InspectorInstrumentation::didDispatchEventOnWindow(cookie); | 1614 InspectorInstrumentation::didDispatchEventOnWindow(cookie); |
1615 | 1615 |
1616 return result; | 1616 return result; |
1617 } | 1617 } |
1618 | 1618 |
1619 void DOMWindow::removeAllEventListeners() | 1619 void DOMWindow::removeAllEventListeners() |
1620 { | 1620 { |
1621 EventTarget::removeAllEventListeners(); | 1621 EventTarget::removeAllEventListeners(); |
1622 | 1622 |
1623 if (DeviceMotionController* controller = DeviceMotionController::from(page()
)) | 1623 if (DeviceMotionController* controller = DeviceMotionController::from(docume
nt())) |
1624 controller->removeAllDeviceEventListeners(this); | 1624 controller->stopUpdating(); |
1625 if (DeviceOrientationController* controller = DeviceOrientationController::f
rom(page())) | 1625 if (DeviceOrientationController* controller = DeviceOrientationController::f
rom(page())) |
1626 controller->removeAllDeviceEventListeners(this); | 1626 controller->removeDeviceEventListener(this); |
1627 if (Document* document = this->document()) | 1627 if (Document* document = this->document()) |
1628 document->didRemoveEventTargetNode(document); | 1628 document->didRemoveEventTargetNode(document); |
1629 | 1629 |
1630 removeAllUnloadEventListeners(this); | 1630 removeAllUnloadEventListeners(this); |
1631 removeAllBeforeUnloadEventListeners(this); | 1631 removeAllBeforeUnloadEventListeners(this); |
1632 } | 1632 } |
1633 | 1633 |
1634 void DOMWindow::captureEvents() | 1634 void DOMWindow::captureEvents() |
1635 { | 1635 { |
1636 // Not implemented. | 1636 // Not implemented. |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1885 WindowFeatures windowFeatures(dialogFeaturesString, screenAvailableRect(m_fr
ame->view())); | 1885 WindowFeatures windowFeatures(dialogFeaturesString, screenAvailableRect(m_fr
ame->view())); |
1886 Frame* dialogFrame = createWindow(urlString, emptyAtom, windowFeatures, | 1886 Frame* dialogFrame = createWindow(urlString, emptyAtom, windowFeatures, |
1887 activeWindow, firstFrame, m_frame, function, functionContext); | 1887 activeWindow, firstFrame, m_frame, function, functionContext); |
1888 if (!dialogFrame) | 1888 if (!dialogFrame) |
1889 return; | 1889 return; |
1890 UserGestureIndicatorDisabler disabler; | 1890 UserGestureIndicatorDisabler disabler; |
1891 dialogFrame->page()->chrome()->runModal(); | 1891 dialogFrame->page()->chrome()->runModal(); |
1892 } | 1892 } |
1893 | 1893 |
1894 } // namespace WebCore | 1894 } // namespace WebCore |
OLD | NEW |