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

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

Issue 13866007: WebKit & WebCore part of the device motion implementation using the platform layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@devicemotion-webcore
Patch Set: added new LICENSE header Created 7 years, 8 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, 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 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 else if (eventType == eventNames().storageEvent) 1615 else if (eventType == eventNames().storageEvent)
1616 didAddStorageEventListener(this); 1616 didAddStorageEventListener(this);
1617 } 1617 }
1618 1618
1619 if (eventType == eventNames().unloadEvent) 1619 if (eventType == eventNames().unloadEvent)
1620 addUnloadEventListener(this); 1620 addUnloadEventListener(this);
1621 else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadLi steners(this)) 1621 else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadLi steners(this))
1622 addBeforeUnloadEventListener(this); 1622 addBeforeUnloadEventListener(this);
1623 #if ENABLE(DEVICE_ORIENTATION) 1623 #if ENABLE(DEVICE_ORIENTATION)
1624 else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatur es::deviceMotionEnabled()) { 1624 else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatur es::deviceMotionEnabled()) {
1625 if (DeviceMotionController* controller = DeviceMotionController::from(pa ge())) 1625 DeviceMotionController::shared().addDeviceEventListener(this);
1626 controller->addDeviceEventListener(this);
1627 } else if (eventType == eventNames().deviceorientationEvent && RuntimeEnable dFeatures::deviceOrientationEnabled()) { 1626 } else if (eventType == eventNames().deviceorientationEvent && RuntimeEnable dFeatures::deviceOrientationEnabled()) {
1628 if (DeviceOrientationController* controller = DeviceOrientationControlle r::from(page())) 1627 if (DeviceOrientationController* controller = DeviceOrientationControlle r::from(page()))
1629 controller->addDeviceEventListener(this); 1628 controller->addDeviceEventListener(this);
1630 } 1629 }
1631 #endif 1630 #endif
1632 1631
1633 #if ENABLE(PROXIMITY_EVENTS) 1632 #if ENABLE(PROXIMITY_EVENTS)
1634 else if (eventType == eventNames().webkitdeviceproximityEvent) { 1633 else if (eventType == eventNames().webkitdeviceproximityEvent) {
1635 if (DeviceProximityController* controller = DeviceProximityController::f rom(page())) 1634 if (DeviceProximityController* controller = DeviceProximityController::f rom(page()))
1636 controller->addDeviceEventListener(this); 1635 controller->addDeviceEventListener(this);
(...skipping 14 matching lines...) Expand all
1651 else if (eventNames().isTouchEventType(eventType)) 1650 else if (eventNames().isTouchEventType(eventType))
1652 document->didRemoveTouchEventHandler(document); 1651 document->didRemoveTouchEventHandler(document);
1653 } 1652 }
1654 1653
1655 if (eventType == eventNames().unloadEvent) 1654 if (eventType == eventNames().unloadEvent)
1656 removeUnloadEventListener(this); 1655 removeUnloadEventListener(this);
1657 else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadLi steners(this)) 1656 else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadLi steners(this))
1658 removeBeforeUnloadEventListener(this); 1657 removeBeforeUnloadEventListener(this);
1659 #if ENABLE(DEVICE_ORIENTATION) 1658 #if ENABLE(DEVICE_ORIENTATION)
1660 else if (eventType == eventNames().devicemotionEvent) { 1659 else if (eventType == eventNames().devicemotionEvent) {
1661 if (DeviceMotionController* controller = DeviceMotionController::from(pa ge())) 1660 DeviceMotionController::shared().removeDeviceEventListener(this);
1662 controller->removeDeviceEventListener(this);
1663 } else if (eventType == eventNames().deviceorientationEvent) { 1661 } else if (eventType == eventNames().deviceorientationEvent) {
1664 if (DeviceOrientationController* controller = DeviceOrientationControlle r::from(page())) 1662 if (DeviceOrientationController* controller = DeviceOrientationControlle r::from(page()))
1665 controller->removeDeviceEventListener(this); 1663 controller->removeDeviceEventListener(this);
1666 } 1664 }
1667 #endif 1665 #endif
1668 1666
1669 #if ENABLE(PROXIMITY_EVENTS) 1667 #if ENABLE(PROXIMITY_EVENTS)
1670 else if (eventType == eventNames().webkitdeviceproximityEvent) { 1668 else if (eventType == eventNames().webkitdeviceproximityEvent) {
1671 if (DeviceProximityController* controller = DeviceProximityController::f rom(page())) 1669 if (DeviceProximityController* controller = DeviceProximityController::f rom(page()))
1672 controller->removeDeviceEventListener(this); 1670 controller->removeDeviceEventListener(this);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1716 InspectorInstrumentation::didDispatchEventOnWindow(cookie); 1714 InspectorInstrumentation::didDispatchEventOnWindow(cookie);
1717 1715
1718 return result; 1716 return result;
1719 } 1717 }
1720 1718
1721 void DOMWindow::removeAllEventListeners() 1719 void DOMWindow::removeAllEventListeners()
1722 { 1720 {
1723 EventTarget::removeAllEventListeners(); 1721 EventTarget::removeAllEventListeners();
1724 1722
1725 #if ENABLE(DEVICE_ORIENTATION) 1723 #if ENABLE(DEVICE_ORIENTATION)
1726 if (DeviceMotionController* controller = DeviceMotionController::from(page() )) 1724 DeviceMotionController::shared().removeAllDeviceEventListeners(this);
1727 controller->removeAllDeviceEventListeners(this);
1728 if (DeviceOrientationController* controller = DeviceOrientationController::f rom(page())) 1725 if (DeviceOrientationController* controller = DeviceOrientationController::f rom(page()))
1729 controller->removeAllDeviceEventListeners(this); 1726 controller->removeAllDeviceEventListeners(this);
1730 #endif 1727 #endif
1731 #if ENABLE(TOUCH_EVENTS) 1728 #if ENABLE(TOUCH_EVENTS)
1732 if (Document* document = this->document()) 1729 if (Document* document = this->document())
1733 document->didRemoveEventTargetNode(document); 1730 document->didRemoveEventTargetNode(document);
1734 #endif 1731 #endif
1735 1732
1736 #if ENABLE(PROXIMITY_EVENTS) 1733 #if ENABLE(PROXIMITY_EVENTS)
1737 if (DeviceProximityController* controller = DeviceProximityController::from( page())) 1734 if (DeviceProximityController* controller = DeviceProximityController::from( page()))
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1996 WindowFeatures windowFeatures(dialogFeaturesString, screenAvailableRect(m_fr ame->view())); 1993 WindowFeatures windowFeatures(dialogFeaturesString, screenAvailableRect(m_fr ame->view()));
1997 Frame* dialogFrame = createWindow(urlString, emptyAtom, windowFeatures, 1994 Frame* dialogFrame = createWindow(urlString, emptyAtom, windowFeatures,
1998 activeWindow, firstFrame, m_frame, function, functionContext); 1995 activeWindow, firstFrame, m_frame, function, functionContext);
1999 if (!dialogFrame) 1996 if (!dialogFrame)
2000 return; 1997 return;
2001 1998
2002 dialogFrame->page()->chrome()->runModal(); 1999 dialogFrame->page()->chrome()->runModal();
2003 } 2000 }
2004 2001
2005 } // namespace WebCore 2002 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698