tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

PlacesVisitTitle.h (1618B)


      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/. */
      6 
      7 #ifndef mozilla_dom_PlacesVisitTitle_h
      8 #define mozilla_dom_PlacesVisitTitle_h
      9 
     10 #include "mozilla/dom/PlacesEvent.h"
     11 
     12 namespace mozilla {
     13 namespace dom {
     14 
     15 class PlacesVisitTitle final : public PlacesEvent {
     16 public:
     17  explicit PlacesVisitTitle()
     18      : PlacesEvent(PlacesEventType::Page_title_changed) {}
     19 
     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();
     27  }
     28 
     29  JSObject* WrapObject(JSContext* aCx,
     30                       JS::Handle<JSObject*> aGivenProto) override {
     31    return PlacesVisitTitle_Binding::Wrap(aCx, this, aGivenProto);
     32  }
     33 
     34  const PlacesVisitTitle* AsPlacesVisitTitle() const override { return this; }
     35 
     36  void GetUrl(nsString& aUrl) const { aUrl = mUrl; }
     37  void GetPageGuid(nsCString& aPageGuid) const { aPageGuid = mPageGuid; }
     38  void GetTitle(nsString& aTitle) const { aTitle = mTitle; }
     39 
     40  nsString mUrl;
     41  nsCString mPageGuid;
     42  nsString mTitle;
     43 
     44 private:
     45  ~PlacesVisitTitle() = default;
     46 };
     47 
     48 }  // namespace dom
     49 }  // namespace mozilla
     50 
     51 #endif  // mozilla_dom_PlacesVisitTitle_h