2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-05-03 23:09:22 -07:00
|
|
|
#include "RootAccessibleWrap.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-02-08 01:35:42 -08:00
|
|
|
#include "mozDocAccessible.h"
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
2008-02-22 12:13:17 -08:00
|
|
|
#include "nsObjCExceptions.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIWidget.h"
|
2013-01-04 19:12:24 -08:00
|
|
|
#include "nsViewManager.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-05-03 23:09:22 -07:00
|
|
|
using namespace mozilla::a11y;
|
|
|
|
|
|
|
|
RootAccessibleWrap::
|
|
|
|
RootAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
|
|
|
|
nsIPresShell* aPresShell) :
|
|
|
|
RootAccessible(aDocument, aRootContent, aPresShell)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-05-03 23:09:22 -07:00
|
|
|
RootAccessibleWrap::~RootAccessibleWrap()
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-05-17 07:00:30 -07:00
|
|
|
Class
|
2012-05-03 23:09:22 -07:00
|
|
|
RootAccessibleWrap::GetNativeType()
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
return [mozRootAccessible class];
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-05-03 23:09:22 -07:00
|
|
|
RootAccessibleWrap::GetNativeWidget(void** aOutView)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
nsIFrame *frame = GetFrame();
|
|
|
|
if (frame) {
|
2013-01-03 05:23:11 -08:00
|
|
|
nsView *view = frame->GetViewExternal();
|
2007-03-22 10:30:00 -07:00
|
|
|
if (view) {
|
|
|
|
nsIWidget *widget = view->GetWidget();
|
|
|
|
if (widget) {
|
|
|
|
*aOutView = (void**)widget->GetNativeData (NS_NATIVE_WIDGET);
|
|
|
|
NS_ASSERTION (*aOutView,
|
|
|
|
"Couldn't get the native NSView parent we need to connect the accessibility hierarchy!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|