/src/mozilla-central/accessible/xpcom/xpcAccessibleGeneric.cpp
Line | Count | Source (jump to first uncovered line) |
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 file, |
5 | | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #include "xpcAccessibleGeneric.h" |
8 | | |
9 | | using namespace mozilla::a11y; |
10 | | |
11 | | //////////////////////////////////////////////////////////////////////////////// |
12 | | // nsISupports |
13 | | |
14 | 0 | NS_INTERFACE_MAP_BEGIN(xpcAccessibleGeneric) |
15 | 0 | NS_INTERFACE_MAP_ENTRY(nsIAccessible) |
16 | 0 | NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIAccessibleSelectable, |
17 | 0 | mSupportedIfaces & eSelectable) |
18 | 0 | NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIAccessibleValue, |
19 | 0 | mSupportedIfaces & eValue) |
20 | 0 | NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIAccessibleHyperLink, |
21 | 0 | mSupportedIfaces & eHyperLink) |
22 | 0 | NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIAccessible) |
23 | 0 | NS_INTERFACE_MAP_END |
24 | | |
25 | | NS_IMPL_ADDREF(xpcAccessibleGeneric) |
26 | | NS_IMPL_RELEASE(xpcAccessibleGeneric) |
27 | | |
28 | | xpcAccessibleGeneric::~xpcAccessibleGeneric() |
29 | 0 | { |
30 | 0 | if (mIntl.IsNull()) { |
31 | 0 | return; |
32 | 0 | } |
33 | 0 | |
34 | 0 | xpcAccessibleDocument* xpcDoc = nullptr; |
35 | 0 | if (mIntl.IsAccessible()) { |
36 | 0 | Accessible* acc = mIntl.AsAccessible(); |
37 | 0 | if (!acc->IsDoc() && !acc->IsApplication()) { |
38 | 0 | xpcDoc = GetAccService()->GetXPCDocument(acc->Document()); |
39 | 0 | xpcDoc->NotifyOfShutdown(acc); |
40 | 0 | } |
41 | 0 | } else { |
42 | 0 | ProxyAccessible* proxy = mIntl.AsProxy(); |
43 | 0 | if (!proxy->IsDoc()) { |
44 | 0 | xpcDoc = GetAccService()->GetXPCDocument(proxy->Document()); |
45 | 0 | xpcDoc->NotifyOfShutdown(proxy); |
46 | 0 | } |
47 | 0 | } |
48 | 0 | } |
49 | | |
50 | | //////////////////////////////////////////////////////////////////////////////// |
51 | | // nsIAccessible |
52 | | |
53 | | Accessible* |
54 | | xpcAccessibleGeneric::ToInternalAccessible() const |
55 | 0 | { |
56 | 0 | return mIntl.AsAccessible(); |
57 | 0 | } |
58 | | |
59 | | //////////////////////////////////////////////////////////////////////////////// |
60 | | // xpcAccessibleGeneric |
61 | | |
62 | | void |
63 | | xpcAccessibleGeneric::Shutdown() |
64 | 0 | { |
65 | 0 | mIntl = nullptr; |
66 | 0 | } |