Bug 1288821 - Convert callObserver/removeObserver to native method; r=snorp

Combine the callObserver and removeObserver methods used for notifying
alert listeners into the native method
GeckoAppShell.notifyAlertListener. Keep track of the listener and the
alert cookie on the native side so that we don't need
GeckoAppShell.ALERT_COOKIES anymore.
This commit is contained in:
Jim Chen
2016-08-04 09:17:54 -04:00
parent 923069e07d
commit d7e3d4d04f
4 changed files with 70 additions and 16 deletions

View File

@@ -53,6 +53,7 @@
#include "mozilla/Logging.h"
#endif
#include "AndroidAlerts.h"
#include "ANRReporter.h"
#include "GeckoNetworkManager.h"
#include "GeckoScreenOrientation.h"
@@ -322,6 +323,17 @@ public:
}
#endif
}
static void NotifyAlertListener(jni::String::Param aName,
jni::String::Param aTopic)
{
if (!aName || !aTopic) {
return;
}
AndroidAlerts::NotifyListener(
aName->ToString(), aTopic->ToCString().get());
}
};
nsAppShell::nsAppShell()