mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge b2g-inbound to m-c.
This commit is contained in:
commit
067fc51bc5
@ -299,6 +299,7 @@ var shell = {
|
||||
window.addEventListener('keyup', this, true);
|
||||
window.addEventListener('MozApplicationManifest', this);
|
||||
window.addEventListener('mozfullscreenchange', this);
|
||||
window.addEventListener('MozAfterPaint', this);
|
||||
window.addEventListener('sizemodechange', this);
|
||||
this.contentBrowser.addEventListener('mozbrowserloadstart', this, true);
|
||||
|
||||
@ -511,6 +512,12 @@ var shell = {
|
||||
dump('Error while creating offline cache: ' + e + '\n');
|
||||
}
|
||||
break;
|
||||
case 'MozAfterPaint':
|
||||
window.removeEventListener('MozAfterPaint', this);
|
||||
this.sendChromeEvent({
|
||||
type: 'system-first-paint'
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"revision": "d9f759cc10938a3caa252e96420531bbb6d6cab3",
|
||||
"revision": "f2d88904536ccd68a3981a7feb17e56b2132838c",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -1143,7 +1143,7 @@ Navigator::GetMozTelephony(ErrorResult& aRv)
|
||||
return mTelephony;
|
||||
}
|
||||
|
||||
nsIDOMMozVoicemail*
|
||||
Voicemail*
|
||||
Navigator::GetMozVoicemail(ErrorResult& aRv)
|
||||
{
|
||||
if (!mVoicemail) {
|
||||
|
@ -35,7 +35,6 @@ class systemMessageCallback;
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
class nsIDOMMozMobileConnection;
|
||||
class nsIDOMMozVoicemail;
|
||||
class nsIDOMMozIccManager;
|
||||
#endif // MOZ_B2G_RIL
|
||||
|
||||
@ -90,6 +89,10 @@ class BluetoothManager;
|
||||
} // namespace bluetooth
|
||||
#endif // MOZ_B2G_BT
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
class Voicemail;
|
||||
#endif
|
||||
|
||||
namespace power {
|
||||
class PowerManager;
|
||||
} // namespace power
|
||||
@ -221,7 +224,7 @@ public:
|
||||
telephony::Telephony* GetMozTelephony(ErrorResult& aRv);
|
||||
nsIDOMMozMobileConnection* GetMozMobileConnection(ErrorResult& aRv);
|
||||
CellBroadcast* GetMozCellBroadcast(ErrorResult& aRv);
|
||||
nsIDOMMozVoicemail* GetMozVoicemail(ErrorResult& aRv);
|
||||
Voicemail* GetMozVoicemail(ErrorResult& aRv);
|
||||
nsIDOMMozIccManager* GetMozIccManager(ErrorResult& aRv);
|
||||
#endif // MOZ_B2G_RIL
|
||||
#ifdef MOZ_GAMEPAD
|
||||
@ -315,7 +318,7 @@ private:
|
||||
nsRefPtr<MobileMessageManager> mMobileMessageManager;
|
||||
#ifdef MOZ_B2G_RIL
|
||||
nsRefPtr<telephony::Telephony> mTelephony;
|
||||
nsCOMPtr<nsIDOMMozVoicemail> mVoicemail;
|
||||
nsRefPtr<Voicemail> mVoicemail;
|
||||
#endif
|
||||
nsRefPtr<network::Connection> mConnection;
|
||||
#ifdef MOZ_B2G_RIL
|
||||
|
@ -170,7 +170,6 @@
|
||||
#include "nsIDOMConnection.h"
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
#include "nsIDOMMozVoicemail.h"
|
||||
#include "nsIDOMIccManager.h"
|
||||
#include "nsIDOMMobileConnection.h"
|
||||
#endif // MOZ_B2G_RIL
|
||||
@ -534,8 +533,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
NS_DEFINE_CLASSINFO_DATA(MozVoicemail, nsEventTargetSH,
|
||||
EVENTTARGET_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(MozIccManager, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
#endif
|
||||
@ -1395,12 +1392,6 @@ nsDOMClassInfo::Init()
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(MozVoicemail, nsIDOMMozVoicemail)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozVoicemail)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(MozIccManager, nsIDOMMozIccManager)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozIccManager)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
||||
|
@ -127,7 +127,6 @@ DOMCI_CLASS(CSSPageRule)
|
||||
DOMCI_CLASS(MediaQueryList)
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
DOMCI_CLASS(MozVoicemail)
|
||||
DOMCI_CLASS(MozIccManager)
|
||||
#endif
|
||||
|
||||
|
@ -772,6 +772,10 @@ DOMInterfaces = {
|
||||
'headerFile': 'StkCommandEvent.h',
|
||||
},
|
||||
|
||||
'MozVoicemail': {
|
||||
'nativeType': 'mozilla::dom::Voicemail',
|
||||
},
|
||||
|
||||
'MutationEvent': {
|
||||
'nativeType': 'nsDOMMutationEvent',
|
||||
},
|
||||
@ -1793,7 +1797,7 @@ addExternalIface('MozTreeBoxObject', nativeType='nsITreeBoxObject',
|
||||
notflattened=True)
|
||||
addExternalIface('MozTreeColumn', nativeType='nsITreeColumn',
|
||||
headerFile='nsITreeColumns.h')
|
||||
addExternalIface('MozVoicemail')
|
||||
addExternalIface('MozVoicemailStatus')
|
||||
addExternalIface('MozWakeLock', headerFile='nsIDOMWakeLock.h')
|
||||
addExternalIface('MozXULTemplateBuilder', nativeType='nsIXULTemplateBuilder')
|
||||
addExternalIface('nsIControllers', nativeType='nsIControllers')
|
||||
|
@ -48,7 +48,7 @@ const ContentPanning = {
|
||||
// If we are using an AsyncPanZoomController for the parent frame,
|
||||
// it will handle subframe scrolling too. We don't need to listen for
|
||||
// these events.
|
||||
if (!this._asyncPanZoomForViewportFrame) {
|
||||
if (!docShell.asyncPanZoomEnabled) {
|
||||
let els = Cc["@mozilla.org/eventlistenerservice;1"]
|
||||
.getService(Ci.nsIEventListenerService);
|
||||
|
||||
@ -140,23 +140,11 @@ const ContentPanning = {
|
||||
let oldTarget = this.target;
|
||||
[this.target, this.scrollCallback] = this.getPannable(this.pointerDownTarget);
|
||||
|
||||
// If we found a target, that means we have found a scrollable subframe. In
|
||||
// this case, and if we are using async panning and zooming on the parent
|
||||
// frame, inform the pan/zoom controller that it should not attempt to
|
||||
// handle any touch events it gets until the next batch (meaning the next
|
||||
// time we get a touch end).
|
||||
if (this.target != null && this._asyncPanZoomForViewportFrame) {
|
||||
this.detectingScrolling = true;
|
||||
var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
|
||||
os.notifyObservers(docShell, 'detect-scrollable-subframe', null);
|
||||
}
|
||||
|
||||
// If we have a pointer down target and we're not async
|
||||
// pan/zooming, we may need to fill in for EventStateManager in
|
||||
// setting the active state on the target element. Set a timer to
|
||||
// If we have a pointer down target, we may need to fill in for EventStateManager
|
||||
// in setting the active state on the target element. Set a timer to
|
||||
// ensure the pointer-down target is active. (If it's already
|
||||
// active, the timer is a no-op.)
|
||||
if (this.pointerDownTarget !== null && !this.detectingScrolling) {
|
||||
if (this.pointerDownTarget !== null) {
|
||||
// If there's no possibility this is a drag/pan, activate now.
|
||||
// Otherwise wait a little bit to see if the gesture isn't a
|
||||
// tap.
|
||||
@ -226,12 +214,6 @@ const ContentPanning = {
|
||||
this.pointerDownTarget = null;
|
||||
},
|
||||
|
||||
// True when there's an async pan-zoom controll watching the
|
||||
// outermost scrollable frame, and we're waiting to see whether
|
||||
// we're going to take over from it and synchronously scroll an
|
||||
// inner scrollable frame.
|
||||
detectingScrolling: false,
|
||||
|
||||
onTouchMove: function cp_onTouchMove(evt) {
|
||||
if (!this.dragging)
|
||||
return;
|
||||
@ -260,27 +242,6 @@ const ContentPanning = {
|
||||
}
|
||||
|
||||
let isPan = KineticPanning.isPan();
|
||||
if (!isPan && this.detectingScrolling) {
|
||||
// If panning distance is not large enough and we're waiting to
|
||||
// see whether we should use the sync scroll fallback or not,
|
||||
// don't attempt scrolling.
|
||||
return;
|
||||
}
|
||||
|
||||
let isScroll = this.scrollCallback(delta.scale(-1));
|
||||
|
||||
if (this.detectingScrolling) {
|
||||
this.detectingScrolling = false;
|
||||
// Stop async-pan-zooming if the user is panning the subframe.
|
||||
if (isScroll) {
|
||||
// We're going to drive synchronously scrolling an inner frame.
|
||||
Services.obs.notifyObservers(docShell, 'cancel-default-pan-zoom', null);
|
||||
} else {
|
||||
// Let AsyncPanZoomController handle the scrolling gesture.
|
||||
this.scrollCallback = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// If we've detected a pan gesture, cancel the active state of the
|
||||
// current target.
|
||||
@ -356,13 +317,6 @@ const ContentPanning = {
|
||||
node = node.parentNode;
|
||||
}
|
||||
|
||||
if (ContentPanning._asyncPanZoomForViewportFrame &&
|
||||
nodeContent === content) {
|
||||
// The parent context is asynchronously panning and zooming our
|
||||
// root scrollable frame, so don't use our synchronous fallback.
|
||||
return null;
|
||||
}
|
||||
|
||||
if (nodeContent.scrollMaxX || nodeContent.scrollMaxY) {
|
||||
return nodeContent;
|
||||
}
|
||||
@ -484,10 +438,6 @@ const ContentPanning = {
|
||||
this._domUtils.setContentState(elt, kStateActive);
|
||||
},
|
||||
|
||||
get _asyncPanZoomForViewportFrame() {
|
||||
return docShell.asyncPanZoomEnabled;
|
||||
},
|
||||
|
||||
_recvViewportChange: function(data) {
|
||||
let metrics = data.json;
|
||||
this._viewport = new Rect(metrics.x, metrics.y,
|
||||
@ -599,7 +549,6 @@ const ContentPanning = {
|
||||
_finishPanning: function() {
|
||||
this._resetActive();
|
||||
this.dragging = false;
|
||||
this.detectingScrolling = false;
|
||||
delete this.primaryPointerId;
|
||||
this._activationTimer.cancel();
|
||||
|
||||
|
@ -105,10 +105,8 @@ NS_IMPL_ISUPPORTS1(ContentListener, nsIDOMEventListener)
|
||||
|
||||
static const CSSSize kDefaultViewportSize(980, 480);
|
||||
|
||||
static const char CANCEL_DEFAULT_PAN_ZOOM[] = "cancel-default-pan-zoom";
|
||||
static const char BROWSER_ZOOM_TO_RECT[] = "browser-zoom-to-rect";
|
||||
static const char BEFORE_FIRST_PAINT[] = "before-first-paint";
|
||||
static const char DETECT_SCROLLABLE_SUBFRAME[] = "detect-scrollable-subframe";
|
||||
|
||||
static bool sCpowsEnabled = false;
|
||||
|
||||
@ -385,13 +383,7 @@ TabChild::Observe(nsISupports *aSubject,
|
||||
const char *aTopic,
|
||||
const PRUnichar *aData)
|
||||
{
|
||||
if (!strcmp(aTopic, CANCEL_DEFAULT_PAN_ZOOM)) {
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aSubject));
|
||||
nsCOMPtr<nsITabChild> tabChild(GetTabChildFrom(docShell));
|
||||
if (tabChild == this) {
|
||||
mRemoteFrame->CancelDefaultPanZoom();
|
||||
}
|
||||
} else if (!strcmp(aTopic, BROWSER_ZOOM_TO_RECT)) {
|
||||
if (!strcmp(aTopic, BROWSER_ZOOM_TO_RECT)) {
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aSubject));
|
||||
nsCOMPtr<nsITabChild> tabChild(GetTabChildFrom(docShell));
|
||||
if (tabChild == this) {
|
||||
@ -436,12 +428,6 @@ TabChild::Observe(nsISupports *aSubject,
|
||||
HandlePossibleViewportChange();
|
||||
}
|
||||
}
|
||||
} else if (!strcmp(aTopic, DETECT_SCROLLABLE_SUBFRAME)) {
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aSubject));
|
||||
nsCOMPtr<nsITabChild> tabChild(GetTabChildFrom(docShell));
|
||||
if (tabChild == this) {
|
||||
mRemoteFrame->DetectScrollableSubframe();
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@ -2183,10 +2169,8 @@ TabChild::RecvDestroy()
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
|
||||
|
||||
observerService->RemoveObserver(this, CANCEL_DEFAULT_PAN_ZOOM);
|
||||
observerService->RemoveObserver(this, BROWSER_ZOOM_TO_RECT);
|
||||
observerService->RemoveObserver(this, BEFORE_FIRST_PAINT);
|
||||
observerService->RemoveObserver(this, DETECT_SCROLLABLE_SUBFRAME);
|
||||
|
||||
const InfallibleTArray<PIndexedDBChild*>& idbActors =
|
||||
ManagedPIndexedDBChild();
|
||||
@ -2321,18 +2305,12 @@ TabChild::InitRenderingState()
|
||||
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
|
||||
|
||||
if (observerService) {
|
||||
observerService->AddObserver(this,
|
||||
CANCEL_DEFAULT_PAN_ZOOM,
|
||||
false);
|
||||
observerService->AddObserver(this,
|
||||
BROWSER_ZOOM_TO_RECT,
|
||||
false);
|
||||
observerService->AddObserver(this,
|
||||
BEFORE_FIRST_PAINT,
|
||||
false);
|
||||
observerService->AddObserver(this,
|
||||
DETECT_SCROLLABLE_SUBFRAME,
|
||||
false);
|
||||
}
|
||||
|
||||
// This state can't really change during the lifetime of the child.
|
||||
|
@ -52,7 +52,8 @@ function testSetCallBarringOptionError(option) {
|
||||
'should not fire onsuccess for invaild call barring option: '
|
||||
+ JSON.stringify(option));
|
||||
};
|
||||
request.onerror = function() {
|
||||
request.onerror = function(event) {
|
||||
is(event.target.error.name, 'InvalidCallBarringOption', JSON.stringify(option));
|
||||
nextTest();
|
||||
};
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ var gData = [
|
||||
{
|
||||
perm: ["voicemail"],
|
||||
obj: "mozVoicemail",
|
||||
idl: "nsIDOMMozVoicemail",
|
||||
webidl: "MozVoicemail",
|
||||
},
|
||||
]
|
||||
</script>
|
||||
|
@ -1086,7 +1086,7 @@ RILContentHelper.prototype = {
|
||||
let requestId = this.getRequestId(request);
|
||||
|
||||
if (DEBUG) debug("setCallBarringOption: " + JSON.stringify(option));
|
||||
if (!this._isValidCallBarringOption(option)) {
|
||||
if (!this._isValidCallBarringOption(option, true)) {
|
||||
this.dispatchFireRequestError(requestId, "InvalidCallBarringOption");
|
||||
return request;
|
||||
}
|
||||
@ -2072,10 +2072,20 @@ RILContentHelper.prototype = {
|
||||
/**
|
||||
* Helper for guarding us against invalid option for call barring.
|
||||
*/
|
||||
_isValidCallBarringOption: function _isValidCallBarringOption(option) {
|
||||
return (option
|
||||
&& option.serviceClass != null
|
||||
&& this._isValidCallBarringProgram(option.program));
|
||||
_isValidCallBarringOption:
|
||||
function _isValidCallBarringOption(option, usedForSetting) {
|
||||
if (!option ||
|
||||
option.serviceClass == null ||
|
||||
!this._isValidCallBarringProgram(option.program)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// For setting callbarring option, |enabled| and |password| are required.
|
||||
if (usedForSetting && (option.enabled == null || option.password == null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -5,6 +5,8 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "Voicemail.h"
|
||||
|
||||
#include "mozilla/dom/MozVoicemailBinding.h"
|
||||
#include "nsIDOMMozVoicemailStatus.h"
|
||||
#include "nsIDOMMozVoicemailEvent.h"
|
||||
|
||||
@ -40,22 +42,11 @@ public:
|
||||
|
||||
NS_IMPL_ISUPPORTS1(Voicemail::Listener, nsIVoicemailListener)
|
||||
|
||||
DOMCI_DATA(MozVoicemail, Voicemail)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(Voicemail)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMMozVoicemail)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozVoicemail)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(Voicemail, nsDOMEventTargetHelper)
|
||||
NS_IMPL_RELEASE_INHERITED(Voicemail, nsDOMEventTargetHelper)
|
||||
|
||||
Voicemail::Voicemail(nsPIDOMWindow* aWindow,
|
||||
nsIVoicemailProvider* aProvider)
|
||||
: mProvider(aProvider)
|
||||
: nsDOMEventTargetHelper(aWindow)
|
||||
, mProvider(aProvider)
|
||||
{
|
||||
BindToOwner(aWindow);
|
||||
|
||||
mListener = new Listener(this);
|
||||
DebugOnly<nsresult> rv = mProvider->RegisterVoicemailMsg(mListener);
|
||||
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
|
||||
@ -70,36 +61,57 @@ Voicemail::~Voicemail()
|
||||
mProvider->UnregisterVoicemailMsg(mListener);
|
||||
}
|
||||
|
||||
// nsIDOMMozVoicemail
|
||||
|
||||
NS_IMETHODIMP
|
||||
Voicemail::GetStatus(nsIDOMMozVoicemailStatus** aStatus)
|
||||
JSObject*
|
||||
Voicemail::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
|
||||
{
|
||||
*aStatus = nullptr;
|
||||
|
||||
NS_ENSURE_STATE(mProvider);
|
||||
return mProvider->GetVoicemailStatus(aStatus);
|
||||
return MozVoicemailBinding::Wrap(aCx, aScope, this);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
Voicemail::GetNumber(nsAString& aNumber)
|
||||
// MozVoicemail WebIDL
|
||||
|
||||
already_AddRefed<nsIDOMMozVoicemailStatus>
|
||||
Voicemail::GetStatus(ErrorResult& aRv) const
|
||||
{
|
||||
if (!mProvider) {
|
||||
aRv.Throw(NS_ERROR_UNEXPECTED);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMMozVoicemailStatus> status;
|
||||
nsresult rv = mProvider->GetVoicemailStatus(getter_AddRefs(status));
|
||||
if (NS_FAILED(rv)) {
|
||||
aRv.Throw(rv);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return status.forget();
|
||||
}
|
||||
|
||||
void
|
||||
Voicemail::GetNumber(nsString& aNumber, ErrorResult& aRv) const
|
||||
{
|
||||
NS_ENSURE_STATE(mProvider);
|
||||
aNumber.SetIsVoid(true);
|
||||
|
||||
return mProvider->GetVoicemailNumber(aNumber);
|
||||
if (!mProvider) {
|
||||
aRv.Throw(NS_ERROR_UNEXPECTED);
|
||||
return;
|
||||
}
|
||||
|
||||
aRv = mProvider->GetVoicemailNumber(aNumber);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
Voicemail::GetDisplayName(nsAString& aDisplayName)
|
||||
void
|
||||
Voicemail::GetDisplayName(nsString& aDisplayName, ErrorResult& aRv) const
|
||||
{
|
||||
NS_ENSURE_STATE(mProvider);
|
||||
aDisplayName.SetIsVoid(true);
|
||||
|
||||
return mProvider->GetVoicemailDisplayName(aDisplayName);
|
||||
}
|
||||
if (!mProvider) {
|
||||
aRv.Throw(NS_ERROR_UNEXPECTED);
|
||||
return;
|
||||
}
|
||||
|
||||
NS_IMPL_EVENT_HANDLER(Voicemail, statuschanged)
|
||||
aRv = mProvider->GetVoicemailDisplayName(aDisplayName);
|
||||
}
|
||||
|
||||
// nsIVoicemailListener
|
||||
|
||||
@ -118,7 +130,7 @@ Voicemail::NotifyStatusChanged(nsIDOMMozVoicemailStatus* aStatus)
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewVoicemail(nsPIDOMWindow* aWindow, nsIDOMMozVoicemail** aVoicemail)
|
||||
NS_NewVoicemail(nsPIDOMWindow* aWindow, Voicemail** aVoicemail)
|
||||
{
|
||||
nsPIDOMWindow* innerWindow = aWindow->IsInnerWindow() ?
|
||||
aWindow :
|
||||
@ -128,8 +140,7 @@ NS_NewVoicemail(nsPIDOMWindow* aWindow, nsIDOMMozVoicemail** aVoicemail)
|
||||
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
|
||||
NS_ENSURE_STATE(provider);
|
||||
|
||||
nsRefPtr<mozilla::dom::Voicemail> voicemail =
|
||||
new mozilla::dom::Voicemail(innerWindow, provider);
|
||||
nsRefPtr<Voicemail> voicemail = new Voicemail(innerWindow, provider);
|
||||
voicemail.forget(aVoicemail);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -7,19 +7,22 @@
|
||||
#ifndef mozilla_dom_voicemail_voicemail_h__
|
||||
#define mozilla_dom_voicemail_voicemail_h__
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "nsDOMEvent.h"
|
||||
#include "nsDOMEventTargetHelper.h"
|
||||
#include "nsIDOMMozVoicemail.h"
|
||||
#include "nsIVoicemailProvider.h"
|
||||
|
||||
class JSObject;
|
||||
struct JSContext;
|
||||
|
||||
class nsPIDOMWindow;
|
||||
class nsIDOMMozVoicemailStatus;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class Voicemail : public nsDOMEventTargetHelper,
|
||||
public nsIDOMMozVoicemail
|
||||
class Voicemail MOZ_FINAL : public nsDOMEventTargetHelper
|
||||
{
|
||||
/**
|
||||
* Class Voicemail doesn't actually inherit nsIVoicemailListener. Instead, it
|
||||
@ -31,15 +34,34 @@ class Voicemail : public nsDOMEventTargetHelper,
|
||||
class Listener;
|
||||
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIDOMMOZVOICEMAIL
|
||||
NS_DECL_NSIVOICEMAILLISTENER
|
||||
|
||||
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper)
|
||||
|
||||
Voicemail(nsPIDOMWindow* aWindow, nsIVoicemailProvider* aProvider);
|
||||
|
||||
virtual ~Voicemail();
|
||||
|
||||
nsPIDOMWindow*
|
||||
GetParentObject() const
|
||||
{
|
||||
return GetOwner();
|
||||
}
|
||||
|
||||
virtual JSObject*
|
||||
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
|
||||
|
||||
already_AddRefed<nsIDOMMozVoicemailStatus>
|
||||
GetStatus(ErrorResult& aRv) const;
|
||||
|
||||
void
|
||||
GetNumber(nsString& aNumber, ErrorResult& aRv) const;
|
||||
|
||||
void
|
||||
GetDisplayName(nsString& aDisplayName, ErrorResult& aRv) const;
|
||||
|
||||
IMPL_EVENT_HANDLER(statuschanged)
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIVoicemailProvider> mProvider;
|
||||
nsRefPtr<Listener> mListener;
|
||||
@ -49,6 +71,7 @@ private:
|
||||
} // namespace mozilla
|
||||
|
||||
nsresult
|
||||
NS_NewVoicemail(nsPIDOMWindow* aWindow, nsIDOMMozVoicemail** aVoicemail);
|
||||
NS_NewVoicemail(nsPIDOMWindow* aWindow,
|
||||
mozilla::dom::Voicemail** aVoicemail);
|
||||
|
||||
#endif // mozilla_dom_voicemail_voicemail_h__
|
||||
|
@ -5,7 +5,6 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMMozVoicemail.idl',
|
||||
'nsIDOMMozVoicemailEvent.idl',
|
||||
'nsIDOMMozVoicemailStatus.idl',
|
||||
'nsIVoicemailProvider.idl',
|
||||
|
@ -4,31 +4,33 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMEventTarget.idl"
|
||||
// nsIDOMMozVoicemailStatus
|
||||
interface MozVoicemailStatus;
|
||||
|
||||
interface nsIDOMMozVoicemailStatus;
|
||||
|
||||
[scriptable, builtinclass, uuid(12e6604b-4981-4aa4-a31f-f77181f8a466)]
|
||||
interface nsIDOMMozVoicemail : nsIDOMEventTarget
|
||||
interface MozVoicemail : EventTarget
|
||||
{
|
||||
/**
|
||||
* The current voicemail status, or null when the status is unknown
|
||||
*/
|
||||
readonly attribute nsIDOMMozVoicemailStatus status;
|
||||
[GetterThrows]
|
||||
readonly attribute MozVoicemailStatus? status;
|
||||
|
||||
/**
|
||||
* The voicemail box dialing number, or null if one wasn't found
|
||||
*/
|
||||
readonly attribute DOMString number;
|
||||
[GetterThrows]
|
||||
readonly attribute DOMString? number;
|
||||
|
||||
/**
|
||||
* The display name of the voicemail box dialing number, or null if one
|
||||
* wasn't found
|
||||
*/
|
||||
readonly attribute DOMString displayName;
|
||||
[GetterThrows]
|
||||
readonly attribute DOMString? displayName;
|
||||
|
||||
/**
|
||||
* The current voicemail status has changed
|
||||
*/
|
||||
[implicit_jscontext] attribute jsval onstatuschanged;
|
||||
[SetterThrows]
|
||||
attribute EventHandler onstatuschanged;
|
||||
};
|
@ -269,8 +269,6 @@ partial interface Navigator {
|
||||
readonly attribute MozCellBroadcast mozCellBroadcast;
|
||||
};
|
||||
|
||||
// nsIMozNavigatorVoicemail
|
||||
interface MozVoicemail;
|
||||
partial interface Navigator {
|
||||
[Throws, Func="Navigator::HasVoicemailSupport"]
|
||||
readonly attribute MozVoicemail mozVoicemail;
|
||||
|
@ -445,6 +445,7 @@ ifdef MOZ_B2G_RIL
|
||||
webidl_files += \
|
||||
CallsList.webidl \
|
||||
MozStkCommandEvent.webidl \
|
||||
MozVoicemail.webidl \
|
||||
Telephony.webidl \
|
||||
TelephonyCall.webidl \
|
||||
TelephonyCallGroup.webidl \
|
||||
|
@ -360,24 +360,6 @@ APZCTreeManager::UpdateCompositionBounds(const ScrollableLayerGuid& aGuid,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
APZCTreeManager::CancelDefaultPanZoom(const ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
nsRefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(aGuid);
|
||||
if (apzc) {
|
||||
apzc->CancelDefaultPanZoom();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
APZCTreeManager::DetectScrollableSubframe(const ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
nsRefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(aGuid);
|
||||
if (apzc) {
|
||||
apzc->DetectScrollableSubframe();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
APZCTreeManager::ZoomToRect(const ScrollableLayerGuid& aGuid,
|
||||
const CSSRect& aRect)
|
||||
|
@ -168,22 +168,6 @@ public:
|
||||
void UpdateCompositionBounds(const ScrollableLayerGuid& aGuid,
|
||||
const ScreenIntRect& aCompositionBounds);
|
||||
|
||||
/**
|
||||
* We are scrolling a subframe, so disable our machinery until we hit
|
||||
* a touch end or a new touch start. This prevents us from accidentally
|
||||
* panning both the subframe and the parent frame.
|
||||
*
|
||||
* XXX/bug 775452: We should eventually be supporting async scrollable
|
||||
* subframes.
|
||||
*/
|
||||
void CancelDefaultPanZoom(const ScrollableLayerGuid& aGuid);
|
||||
|
||||
/**
|
||||
* We have found a scrollable subframe, so we need to delay the scrolling
|
||||
* gesture executed and let subframe do the scrolling first.
|
||||
*/
|
||||
void DetectScrollableSubframe(const ScrollableLayerGuid& aGuid);
|
||||
|
||||
/**
|
||||
* Kicks an animation to zoom to a rect. This may be either a zoom out or zoom
|
||||
* in. The actual animation is done on the compositor thread after being set
|
||||
|
@ -212,9 +212,7 @@ AsyncPanZoomController::AsyncPanZoomController(uint64_t aLayersId,
|
||||
mLastAsyncScrollOffset(0, 0),
|
||||
mCurrentAsyncScrollOffset(0, 0),
|
||||
mAsyncScrollTimeoutTask(nullptr),
|
||||
mDisableNextTouchBatch(false),
|
||||
mHandlingTouchQueue(false),
|
||||
mDelayPanning(false)
|
||||
mHandlingTouchQueue(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(AsyncPanZoomController);
|
||||
|
||||
@ -312,29 +310,12 @@ nsEventStatus AsyncPanZoomController::HandleInputEvent(const InputData& aEvent)
|
||||
nsEventStatus rv = nsEventStatus_eIgnore;
|
||||
|
||||
nsRefPtr<GestureEventListener> listener = GetGestureEventListener();
|
||||
if (listener && !mDisableNextTouchBatch) {
|
||||
if (listener) {
|
||||
rv = listener->HandleInputEvent(aEvent);
|
||||
if (rv == nsEventStatus_eConsumeNoDefault)
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (mDelayPanning && aEvent.mInputType == MULTITOUCH_INPUT) {
|
||||
const MultiTouchInput& multiTouchInput = aEvent.AsMultiTouchInput();
|
||||
if (multiTouchInput.mType == MultiTouchInput::MULTITOUCH_MOVE) {
|
||||
// Let BrowserElementScrolling perform panning gesture first.
|
||||
SetState(WAITING_LISTENERS);
|
||||
mTouchQueue.AppendElement(multiTouchInput);
|
||||
|
||||
if (!mTouchListenerTimeoutTask) {
|
||||
mTouchListenerTimeoutTask =
|
||||
NewRunnableMethod(this, &AsyncPanZoomController::TimeoutTouchListeners);
|
||||
|
||||
PostDelayedTask(mTouchListenerTimeoutTask, gTouchListenerTimeout);
|
||||
}
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
}
|
||||
|
||||
switch (aEvent.mInputType) {
|
||||
case MULTITOUCH_INPUT: {
|
||||
const MultiTouchInput& multiTouchInput = aEvent.AsMultiTouchInput();
|
||||
@ -416,10 +397,6 @@ nsEventStatus AsyncPanZoomController::OnTouchStart(const MultiTouchInput& aEvent
|
||||
}
|
||||
|
||||
nsEventStatus AsyncPanZoomController::OnTouchMove(const MultiTouchInput& aEvent) {
|
||||
if (mDisableNextTouchBatch) {
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
switch (mState) {
|
||||
case FLING:
|
||||
case NOTHING:
|
||||
@ -459,11 +436,6 @@ nsEventStatus AsyncPanZoomController::OnTouchMove(const MultiTouchInput& aEvent)
|
||||
}
|
||||
|
||||
nsEventStatus AsyncPanZoomController::OnTouchEnd(const MultiTouchInput& aEvent) {
|
||||
if (mDisableNextTouchBatch) {
|
||||
mDisableNextTouchBatch = false;
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
{
|
||||
ReentrantMonitorAutoEnter lock(mMonitor);
|
||||
SendAsyncScrollEvent();
|
||||
@ -1185,18 +1157,6 @@ void AsyncPanZoomController::UpdateCompositionBounds(const ScreenIntRect& aCompo
|
||||
}
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::CancelDefaultPanZoom() {
|
||||
mDisableNextTouchBatch = true;
|
||||
nsRefPtr<GestureEventListener> listener = GetGestureEventListener();
|
||||
if (listener) {
|
||||
listener->CancelGesture();
|
||||
}
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::DetectScrollableSubframe() {
|
||||
mDelayPanning = true;
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::ZoomToRect(CSSRect aRect) {
|
||||
SetState(ANIMATING_ZOOM);
|
||||
|
||||
@ -1276,7 +1236,7 @@ void AsyncPanZoomController::ZoomToRect(CSSRect aRect) {
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::ContentReceivedTouch(bool aPreventDefault) {
|
||||
if (!mFrameMetrics.mMayHaveTouchListeners && !mDelayPanning) {
|
||||
if (!mFrameMetrics.mMayHaveTouchListeners) {
|
||||
mTouchQueue.Clear();
|
||||
return;
|
||||
}
|
||||
@ -1288,21 +1248,12 @@ void AsyncPanZoomController::ContentReceivedTouch(bool aPreventDefault) {
|
||||
|
||||
if (mState == WAITING_LISTENERS) {
|
||||
if (!aPreventDefault) {
|
||||
// Delayed scrolling gesture is pending at TOUCHING state.
|
||||
if (mDelayPanning) {
|
||||
SetState(TOUCHING);
|
||||
} else {
|
||||
SetState(NOTHING);
|
||||
}
|
||||
SetState(NOTHING);
|
||||
}
|
||||
|
||||
mHandlingTouchQueue = true;
|
||||
|
||||
while (!mTouchQueue.IsEmpty()) {
|
||||
// we need to reset mDelayPanning before handling scrolling gesture.
|
||||
if (!aPreventDefault && mTouchQueue[0].mType == MultiTouchInput::MULTITOUCH_MOVE) {
|
||||
mDelayPanning = false;
|
||||
}
|
||||
if (!aPreventDefault) {
|
||||
HandleInputEvent(mTouchQueue[0]);
|
||||
}
|
||||
|
@ -109,22 +109,6 @@ public:
|
||||
*/
|
||||
void UpdateCompositionBounds(const ScreenIntRect& aCompositionBounds);
|
||||
|
||||
/**
|
||||
* We are scrolling a subframe, so disable our machinery until we hit
|
||||
* a touch end or a new touch start. This prevents us from accidentally
|
||||
* panning both the subframe and the parent frame.
|
||||
*
|
||||
* XXX/bug 775452: We should eventually be supporting async scrollable
|
||||
* subframes.
|
||||
*/
|
||||
void CancelDefaultPanZoom();
|
||||
|
||||
/**
|
||||
* We have found a scrollable subframe, so we need to delay the scrolling
|
||||
* gesture executed and let subframe do the scrolling first.
|
||||
*/
|
||||
void DetectScrollableSubframe();
|
||||
|
||||
/**
|
||||
* Kicks an animation to zoom to a rect. This may be either a zoom out or zoom
|
||||
* in. The actual animation is done on the compositor thread after being set
|
||||
@ -580,22 +564,12 @@ private:
|
||||
// ensures the last mozbrowserasyncscroll event is always been fired.
|
||||
CancelableTask* mAsyncScrollTimeoutTask;
|
||||
|
||||
// Flag used to determine whether or not we should disable handling of the
|
||||
// next batch of touch events. This is used for sync scrolling of subframes.
|
||||
bool mDisableNextTouchBatch;
|
||||
|
||||
// Flag used to determine whether or not we should try to enter the
|
||||
// WAITING_LISTENERS state. This is used in the case that we are processing a
|
||||
// queued up event block. If set, this means that we are handling this queue
|
||||
// and we don't want to queue the events back up again.
|
||||
bool mHandlingTouchQueue;
|
||||
|
||||
// Flag used to determine whether or not we should try scrolling by
|
||||
// BrowserElementScrolling first. If set, we delay delivering
|
||||
// touchmove events to GestureListener until BrowserElementScrolling
|
||||
// decides whether it wants to handle panning for this touch series.
|
||||
bool mDelayPanning;
|
||||
|
||||
friend class Axis;
|
||||
|
||||
/* The functions and members in this section are used to build a tree
|
||||
|
@ -45,9 +45,6 @@ parent:
|
||||
|
||||
async NotifyCompositorTransaction();
|
||||
|
||||
async CancelDefaultPanZoom();
|
||||
async DetectScrollableSubframe();
|
||||
|
||||
async UpdateHitRegion(nsRegion aRegion);
|
||||
|
||||
async __delete__();
|
||||
|
@ -32,18 +32,6 @@ RenderFrameChild::Destroy()
|
||||
// WARNING: |this| is dead, hands off
|
||||
}
|
||||
|
||||
void
|
||||
RenderFrameChild::CancelDefaultPanZoom()
|
||||
{
|
||||
SendCancelDefaultPanZoom();
|
||||
}
|
||||
|
||||
void
|
||||
RenderFrameChild::DetectScrollableSubframe()
|
||||
{
|
||||
SendDetectScrollableSubframe();
|
||||
}
|
||||
|
||||
PLayerTransactionChild*
|
||||
RenderFrameChild::AllocPLayerTransactionChild()
|
||||
{
|
||||
|
@ -19,9 +19,6 @@ public:
|
||||
RenderFrameChild() {}
|
||||
virtual ~RenderFrameChild() {}
|
||||
|
||||
void CancelDefaultPanZoom();
|
||||
void DetectScrollableSubframe();
|
||||
|
||||
void Destroy();
|
||||
|
||||
protected:
|
||||
|
@ -846,24 +846,6 @@ RenderFrameParent::RecvNotifyCompositorTransaction()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
RenderFrameParent::RecvCancelDefaultPanZoom()
|
||||
{
|
||||
if (GetApzcTreeManager()) {
|
||||
GetApzcTreeManager()->CancelDefaultPanZoom(ScrollableLayerGuid(mLayersId));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
RenderFrameParent::RecvDetectScrollableSubframe()
|
||||
{
|
||||
if (GetApzcTreeManager()) {
|
||||
GetApzcTreeManager()->DetectScrollableSubframe(ScrollableLayerGuid(mLayersId));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
RenderFrameParent::RecvUpdateHitRegion(const nsRegion& aRegion)
|
||||
{
|
||||
|
@ -117,9 +117,6 @@ protected:
|
||||
|
||||
virtual bool RecvNotifyCompositorTransaction() MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvCancelDefaultPanZoom() MOZ_OVERRIDE;
|
||||
virtual bool RecvDetectScrollableSubframe() MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvUpdateHitRegion(const nsRegion& aRegion) MOZ_OVERRIDE;
|
||||
|
||||
virtual PLayerTransactionParent* AllocPLayerTransactionParent() MOZ_OVERRIDE;
|
||||
|
Loading…
Reference in New Issue
Block a user