1 /* -*- Mode: C++; tab-width: 2; 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/. */
6 #include "RootAccessibleWrap.h"
8 #include "mozDocAccessible.h"
11 #include "nsObjCExceptions.h"
14 #include "nsIWidget.h"
16 using namespace mozilla::a11y;
19 RootAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
20 nsIPresShell* aPresShell) :
21 RootAccessible(aDocument, aRootContent, aPresShell)
25 RootAccessibleWrap::~RootAccessibleWrap()
30 RootAccessibleWrap::GetNativeType()
32 NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
34 return [mozRootAccessible class];
36 NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
40 RootAccessibleWrap::GetNativeWidget(void** aOutView)
42 nsIFrame *frame = GetFrame();
44 nsView *view = frame->GetViewExternal();
46 nsIWidget *widget = view->GetWidget();
48 *aOutView = (void**)widget->GetNativeData (NS_NATIVE_WIDGET);
49 NS_ASSERTION (*aOutView,
50 "Couldn't get the native NSView parent we need to connect the accessibility hierarchy!");