tor-browser

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

nsMaiInterfaceHyperlinkImpl.cpp (915B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=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/. */
      6 
      7 #include "InterfaceInitFuncs.h"
      8 
      9 #include "nsMaiHyperlink.h"
     10 #include "mozilla/Likely.h"
     11 
     12 using namespace mozilla::a11y;
     13 
     14 extern "C" {
     15 static AtkHyperlink* getHyperlinkCB(AtkHyperlinkImpl* aImpl) {
     16  Accessible* acc = GetInternalObj(ATK_OBJECT(aImpl));
     17  if (!acc) {
     18    return nullptr;
     19  }
     20 
     21  NS_ASSERTION(acc->IsLink(), "why isn't it a link!");
     22 
     23  return MAI_ATK_OBJECT(aImpl)->GetAtkHyperlink();
     24 }
     25 }
     26 
     27 void hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface* aIface) {
     28  NS_ASSERTION(aIface, "no interface!");
     29  if (MOZ_UNLIKELY(!aIface)) return;
     30 
     31  aIface->get_hyperlink = getHyperlinkCB;
     32 }