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_PlacesVisitTitle_h
8 #define mozilla_dom_PlacesVisitTitle_h
10 #include "mozilla/dom/PlacesEvent.h"
15 class PlacesVisitTitle final
: public PlacesEvent
{
17 explicit PlacesVisitTitle()
18 : PlacesEvent(PlacesEventType::Page_title_changed
) {}
20 static already_AddRefed
<PlacesVisitTitle
> Constructor(
21 const GlobalObject
& aGlobal
, const PlacesVisitTitleInit
& aInitDict
) {
22 RefPtr
<PlacesVisitTitle
> event
= new PlacesVisitTitle();
23 event
->mUrl
= aInitDict
.mUrl
;
24 event
->mPageGuid
= aInitDict
.mPageGuid
;
25 event
->mTitle
= aInitDict
.mTitle
;
26 return event
.forget();
29 JSObject
* WrapObject(JSContext
* aCx
,
30 JS::Handle
<JSObject
*> aGivenProto
) override
{
31 return PlacesVisitTitle_Binding::Wrap(aCx
, this, aGivenProto
);
34 const PlacesVisitTitle
* AsPlacesVisitTitle() const override
{ return this; }
36 void GetUrl(nsString
& aUrl
) const { aUrl
= mUrl
; }
37 void GetPageGuid(nsCString
& aPageGuid
) const { aPageGuid
= mPageGuid
; }
38 void GetTitle(nsString
& aTitle
) const { aTitle
= mTitle
; }
45 ~PlacesVisitTitle() = default;
49 } // namespace mozilla
51 #endif // mozilla_dom_PlacesVisitTitle_h