mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 734855 - Rename DeviceMotion to DeviceSensors. Review comments address r=mwu
This commit is contained in:
parent
d24b5a906e
commit
59d0282757
@ -37,6 +37,10 @@
|
||||
|
||||
#include "mozilla/Hal.h"
|
||||
#include "mozilla/HalSensor.h"
|
||||
|
||||
// Microsoft's API Name hackery sucks
|
||||
#undef CreateEvent
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsDOMEvent.h"
|
||||
|
@ -519,7 +519,6 @@ public:
|
||||
|
||||
virtual void EnableDeviceSensor(PRUint32 aType);
|
||||
virtual void DisableDeviceSensor(PRUint32 aType);
|
||||
nsTArray<PRUint32> mEnabledSensors;
|
||||
|
||||
virtual nsresult SetArguments(nsIArray *aArguments, nsIPrincipal *aOrigin);
|
||||
|
||||
@ -990,6 +989,8 @@ protected:
|
||||
|
||||
nsTHashtable<nsPtrHashKey<nsDOMEventTargetHelper> > mEventTargetObjects;
|
||||
|
||||
nsTArray<PRUint32> mEnabledSensors;
|
||||
|
||||
friend class nsDOMScriptableHelper;
|
||||
friend class nsDOMWindowUtils;
|
||||
friend class PostMessageEvent;
|
||||
|
@ -173,14 +173,17 @@ NS_IMETHODIMP nsDeviceSensors::RemoveWindowListener(PRUint32 aType, nsIDOMWindow
|
||||
return NS_OK;
|
||||
|
||||
mWindowListeners[aType]->RemoveElement(aWindow);
|
||||
|
||||
if (mWindowListeners[aType]->Length() == 0)
|
||||
UnregisterSensorObserver((SensorType)aType, this);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceSensors::RemoveWindowAsListener(nsIDOMWindow *aWindow)
|
||||
{
|
||||
for (int i = 0; i < NUM_SENSOR_TYPE; i++) {
|
||||
if (IsSensorEnabled(i))
|
||||
RemoveWindowListener((SensorType)i, aWindow);
|
||||
RemoveWindowListener((SensorType)i, aWindow);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -74,9 +74,6 @@ private:
|
||||
// sensor -> window listener
|
||||
nsTArray<nsTArray<nsIDOMWindow*>* > mWindowListeners;
|
||||
|
||||
// window -> sensortype enabled
|
||||
nsDataHashtable<nsUint32HashKey, nsTArray<PRUint32 > > mSensorsEnabled;
|
||||
|
||||
void FireDOMOrientationEvent(class nsIDOMDocument *domDoc,
|
||||
class nsIDOMEventTarget *target,
|
||||
double alpha,
|
||||
|
Loading…
Reference in New Issue
Block a user