michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "RootAccessibleWrap.h" michael@0: michael@0: #include "mozDocAccessible.h" michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "nsObjCExceptions.h" michael@0: #include "nsIFrame.h" michael@0: #include "nsView.h" michael@0: #include "nsIWidget.h" michael@0: michael@0: using namespace mozilla::a11y; michael@0: michael@0: RootAccessibleWrap:: michael@0: RootAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent, michael@0: nsIPresShell* aPresShell) : michael@0: RootAccessible(aDocument, aRootContent, aPresShell) michael@0: { michael@0: } michael@0: michael@0: RootAccessibleWrap::~RootAccessibleWrap() michael@0: { michael@0: } michael@0: michael@0: Class michael@0: RootAccessibleWrap::GetNativeType() michael@0: { michael@0: NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; michael@0: michael@0: return [mozRootAccessible class]; michael@0: michael@0: NS_OBJC_END_TRY_ABORT_BLOCK_NIL; michael@0: } michael@0: michael@0: void michael@0: RootAccessibleWrap::GetNativeWidget(void** aOutView) michael@0: { michael@0: nsIFrame *frame = GetFrame(); michael@0: if (frame) { michael@0: nsView *view = frame->GetViewExternal(); michael@0: if (view) { michael@0: nsIWidget *widget = view->GetWidget(); michael@0: if (widget) { michael@0: *aOutView = (void**)widget->GetNativeData (NS_NATIVE_WIDGET); michael@0: NS_ASSERTION (*aOutView, michael@0: "Couldn't get the native NSView parent we need to connect the accessibility hierarchy!"); michael@0: } michael@0: } michael@0: } michael@0: }