widget/windows/winrt/UIAAccessibilityBridge.cpp

branch
TOR_BUG_9701
changeset 10
ac0c01689b40
equal deleted inserted replaced
-1:000000000000 0:10277dae29fd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 #if defined(ACCESSIBILITY)
7
8 #include "UIAAccessibilityBridge.h"
9 #include "MetroUtils.h"
10
11 #include <OAIdl.h>
12
13 #include "nsIAccessibleEvent.h"
14 #include "nsIAccessibleEditableText.h"
15 #include "nsIPersistentProperties2.h"
16
17 // generated
18 #include "UIABridge.h"
19
20 #include <wrl/implements.h>
21
22 using namespace mozilla::a11y;
23
24 namespace mozilla {
25 namespace widget {
26 namespace winrt {
27
28 using namespace Microsoft::WRL;
29
30 NS_IMPL_ISUPPORTS(AccessibilityBridge, nsIObserver)
31
32 nsresult
33 AccessibilityBridge::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *aData)
34 {
35 nsCOMPtr<nsIAccessibleEvent> ev = do_QueryInterface(aSubject);
36 if (!ev) {
37 return NS_OK;
38 }
39
40 uint32_t eventType = 0;
41 ev->GetEventType(&eventType);
42 if (eventType == nsIAccessibleEvent::EVENT_FOCUS) {
43 Microsoft::WRL::ComPtr<IUIABridge> bridgePtr;
44 mBridge.As(&bridgePtr);
45 if (bridgePtr) {
46 bridgePtr->FocusChangeEvent();
47 }
48 }
49
50 return NS_OK;
51 }
52
53 } } }
54
55 #endif // ACCESSIBILITY

mercurial