Bumping manifests a=b2g-bump
[gecko.git] / accessible / mac / RootAccessibleWrap.mm
blob338d154bb179eab6a8f81531b48f992fe7ab9a15
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"
10 #include "nsCOMPtr.h"
11 #include "nsObjCExceptions.h"
12 #include "nsIFrame.h"
13 #include "nsView.h"
14 #include "nsIWidget.h"
16 using namespace mozilla::a11y;
18 RootAccessibleWrap::
19   RootAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
20                      nsIPresShell* aPresShell) :
21   RootAccessible(aDocument, aRootContent, aPresShell)
25 RootAccessibleWrap::~RootAccessibleWrap()
29 Class
30 RootAccessibleWrap::GetNativeType()
32   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
34   return [mozRootAccessible class];
36   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
39 void
40 RootAccessibleWrap::GetNativeWidget(void** aOutView)
42   nsIFrame *frame = GetFrame();
43   if (frame) {
44     nsView *view = frame->GetViewExternal();
45     if (view) {
46       nsIWidget *widget = view->GetWidget();
47       if (widget) {
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!");
51       }
52     }
53   }