1 /* -*- Mode: IDL; 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 file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
7 callback PlacesEventCallback = undefined (sequence<PlacesEvent> events);
9 [ChromeOnly, Exposed=Window]
10 interface PlacesWeakCallbackWrapper {
11 constructor(PlacesEventCallback callback);
14 // Counters for number of events sent in the current session.
15 [ChromeOnly, Exposed=Window]
16 interface PlacesEventCounts {
17 readonly maplike<DOMString, unsigned long long>;
20 // Global singleton which should handle all events for places.
21 [ChromeOnly, Exposed=Window]
22 namespace PlacesObservers {
24 undefined addListener(sequence<PlacesEventType> eventTypes,
25 PlacesEventCallback listener);
27 undefined addListener(sequence<PlacesEventType> eventTypes,
28 PlacesWeakCallbackWrapper listener);
30 undefined removeListener(sequence<PlacesEventType> eventTypes,
31 PlacesEventCallback listener);
33 undefined removeListener(sequence<PlacesEventType> eventTypes,
34 PlacesWeakCallbackWrapper listener);
36 undefined notifyListeners(sequence<PlacesEvent> events);
38 readonly attribute PlacesEventCounts counts;