accessible/src/mac/RootAccessibleWrap.mm

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "RootAccessibleWrap.h"
michael@0 7
michael@0 8 #include "mozDocAccessible.h"
michael@0 9
michael@0 10 #include "nsCOMPtr.h"
michael@0 11 #include "nsObjCExceptions.h"
michael@0 12 #include "nsIFrame.h"
michael@0 13 #include "nsView.h"
michael@0 14 #include "nsIWidget.h"
michael@0 15
michael@0 16 using namespace mozilla::a11y;
michael@0 17
michael@0 18 RootAccessibleWrap::
michael@0 19 RootAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
michael@0 20 nsIPresShell* aPresShell) :
michael@0 21 RootAccessible(aDocument, aRootContent, aPresShell)
michael@0 22 {
michael@0 23 }
michael@0 24
michael@0 25 RootAccessibleWrap::~RootAccessibleWrap()
michael@0 26 {
michael@0 27 }
michael@0 28
michael@0 29 Class
michael@0 30 RootAccessibleWrap::GetNativeType()
michael@0 31 {
michael@0 32 NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
michael@0 33
michael@0 34 return [mozRootAccessible class];
michael@0 35
michael@0 36 NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
michael@0 37 }
michael@0 38
michael@0 39 void
michael@0 40 RootAccessibleWrap::GetNativeWidget(void** aOutView)
michael@0 41 {
michael@0 42 nsIFrame *frame = GetFrame();
michael@0 43 if (frame) {
michael@0 44 nsView *view = frame->GetViewExternal();
michael@0 45 if (view) {
michael@0 46 nsIWidget *widget = view->GetWidget();
michael@0 47 if (widget) {
michael@0 48 *aOutView = (void**)widget->GetNativeData (NS_NATIVE_WIDGET);
michael@0 49 NS_ASSERTION (*aOutView,
michael@0 50 "Couldn't get the native NSView parent we need to connect the accessibility hierarchy!");
michael@0 51 }
michael@0 52 }
michael@0 53 }
michael@0 54 }

mercurial