1 /* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_widget_AndroidAlerts_h__
7 #define mozilla_widget_AndroidAlerts_h__
9 #include "nsTHashMap.h"
10 #include "nsInterfaceHashtable.h"
12 #include "nsHashKeys.h"
13 #include "nsIAlertsService.h"
14 #include "nsIObserver.h"
16 #include "mozilla/java/WebNotificationWrappers.h"
18 #include "mozilla/StaticPtr.h"
23 class AndroidAlerts
: public nsIAlertsService
{
26 NS_DECL_NSIALERTSSERVICE
30 static void NotifyListener(const nsAString
& aName
, const char* aTopic
,
31 const char16_t
* aCookie
);
33 static nsTHashMap
<nsStringHashKey
, mozilla::java::WebNotification::GlobalRef
>
37 virtual ~AndroidAlerts() { sListenerMap
= nullptr; }
39 using ListenerMap
= nsInterfaceHashtable
<nsStringHashKey
, nsIObserver
>;
40 static StaticAutoPtr
<ListenerMap
> sListenerMap
;
44 } // namespace mozilla
46 #endif // nsAndroidAlerts_h__