Bug 1885602 - Part 3: Add MenuHeader for the menu redesign r=android-reviewers,007
[gecko.git] / dom / geolocation / GeolocationPositionError.h
blobc379149791ea7d94320313ae2e177186a58a783f
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_GeolocationPositionError_h
8 #define mozilla_dom_GeolocationPositionError_h
10 #include "nsWrapperCache.h"
11 #include "nsISupportsImpl.h"
12 #include "nsCycleCollectionParticipant.h"
13 #include "mozilla/dom/CallbackObject.h"
15 class nsIDOMGeoPositionErrorCallback;
17 namespace mozilla::dom {
18 class PositionErrorCallback;
19 class Geolocation;
20 typedef CallbackObjectHolder<PositionErrorCallback,
21 nsIDOMGeoPositionErrorCallback>
22 GeoPositionErrorCallback;
24 class GeolocationPositionError final : public nsWrapperCache {
25 public:
26 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(GeolocationPositionError)
27 NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(GeolocationPositionError)
29 GeolocationPositionError(Geolocation* aParent, int16_t aCode);
31 nsWrapperCache* GetParentObject() const;
33 virtual JSObject* WrapObject(JSContext* aCx,
34 JS::Handle<JSObject*> aGivenProto) override;
36 int16_t Code() const { return mCode; }
38 void GetMessage(nsAString& aMessage) const;
40 MOZ_CAN_RUN_SCRIPT
41 void NotifyCallback(const GeoPositionErrorCallback& callback);
43 private:
44 ~GeolocationPositionError();
45 int16_t mCode;
46 RefPtr<Geolocation> mParent;
49 } // namespace mozilla::dom
51 #endif /* mozilla_dom_GeolocationPositionError_h */