tor-browser

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

AccessibleWrap.cpp (1583B)


      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 "AccessibleWrap.h"
      8 #include "MsaaAccessible.h"
      9 
     10 using namespace mozilla;
     11 using namespace mozilla::a11y;
     12 
     13 /* For documentation of the accessibility architecture,
     14 * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html
     15 */
     16 
     17 ////////////////////////////////////////////////////////////////////////////////
     18 // AccessibleWrap
     19 ////////////////////////////////////////////////////////////////////////////////
     20 AccessibleWrap::AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc)
     21    : LocalAccessible(aContent, aDoc) {}
     22 
     23 AccessibleWrap::~AccessibleWrap() = default;
     24 
     25 NS_IMPL_ISUPPORTS_INHERITED0(AccessibleWrap, LocalAccessible)
     26 
     27 void AccessibleWrap::Shutdown() {
     28  if (mMsaa) {
     29    mMsaa->MsaaShutdown();
     30    // Don't release mMsaa here because this will cause its id to be released
     31    // immediately, which will result in immediate reuse, causing problems
     32    // for clients. Instead, we release it in the destructor.
     33  }
     34  LocalAccessible::Shutdown();
     35 }
     36 
     37 MsaaAccessible* AccessibleWrap::GetMsaa() {
     38  if (!mMsaa) {
     39    mMsaa = MsaaAccessible::Create(this);
     40  }
     41  return mMsaa;
     42 }
     43 
     44 void AccessibleWrap::GetNativeInterface(void** aOutAccessible) {
     45  RefPtr<IAccessible> result = GetMsaa();
     46  return result.forget(aOutAccessible);
     47 }