Bug 1842773 - Part 5: Add ArrayBuffer.prototype.{maxByteLength,resizable} getters...
[gecko.git] / dom / base / PlacesFavicon.h
blobda186e7d16575a94f9cfa7e9a48bfcb572156b9c
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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_PlacesFavicon_h
8 #define mozilla_dom_PlacesFavicon_h
10 #include "mozilla/dom/PlacesEvent.h"
12 namespace mozilla {
13 namespace dom {
15 class PlacesFavicon final : public PlacesEvent {
16 public:
17 explicit PlacesFavicon() : PlacesEvent(PlacesEventType::Favicon_changed) {}
19 static already_AddRefed<PlacesFavicon> Constructor(
20 const GlobalObject& aGlobal, const PlacesFaviconInit& aInitDict) {
21 RefPtr<PlacesFavicon> event = new PlacesFavicon();
22 event->mUrl = aInitDict.mUrl;
23 event->mPageGuid = aInitDict.mPageGuid;
24 event->mFaviconUrl = aInitDict.mFaviconUrl;
25 return event.forget();
28 JSObject* WrapObject(JSContext* aCx,
29 JS::Handle<JSObject*> aGivenProto) override {
30 return PlacesFavicon_Binding::Wrap(aCx, this, aGivenProto);
33 const PlacesFavicon* AsPlacesFavicon() const override { return this; }
35 void GetUrl(nsString& aUrl) const { aUrl = mUrl; }
36 void GetPageGuid(nsCString& aPageGuid) const { aPageGuid = mPageGuid; }
37 void GetFaviconUrl(nsString& aFaviconUrl) const { aFaviconUrl = mFaviconUrl; }
39 nsString mUrl;
40 nsCString mPageGuid;
41 nsString mFaviconUrl;
43 private:
44 ~PlacesFavicon() = default;
47 } // namespace dom
48 } // namespace mozilla
50 #endif // mozilla_dom_PlacesFavicon_h