1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim:expandtab:shiftwidth=4:tabstop=4: 3 */ 4 /* This Source Code Form is subject to the terms of the Mozilla Public 5 * License, v. 2.0. If a copy of the MPL was not distributed with this 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 7 8 #include "ApplicationAccessibleWrap.h" 9 10 #include "nsIGfxInfo.h" 11 #include "AccAttributes.h" 12 #include "nsServiceManagerUtils.h" 13 #include "mozilla/Components.h" 14 15 using namespace mozilla; 16 using namespace mozilla::a11y; 17 18 //////////////////////////////////////////////////////////////////////////////// 19 // nsISupports NS_IMPL_ISUPPORTS_INHERITED0(ApplicationAccessibleWrap,ApplicationAccessible)20NS_IMPL_ISUPPORTS_INHERITED0(ApplicationAccessibleWrap, ApplicationAccessible) 21 22 already_AddRefed<AccAttributes> ApplicationAccessibleWrap::NativeAttributes() { 23 RefPtr<AccAttributes> attributes = new AccAttributes(); 24 25 nsCOMPtr<nsIGfxInfo> gfxInfo = components::GfxInfo::Service(); 26 if (gfxInfo) { 27 bool isD2DEnabled = false; 28 gfxInfo->GetD2DEnabled(&isD2DEnabled); 29 RefPtr<nsAtom> attrName = NS_Atomize(u"D2D"_ns); 30 attributes->SetAttribute(attrName, isD2DEnabled); 31 } 32 33 return attributes.forget(); 34 } 35 Shutdown()36void ApplicationAccessibleWrap::Shutdown() { 37 // ApplicationAccessible::Shutdown doesn't call AccessibleWrap::Shutdown, so 38 // we have to call MsaaShutdown here. 39 if (mMsaa) { 40 mMsaa->MsaaShutdown(); 41 } 42 ApplicationAccessible::Shutdown(); 43 } 44