accessible/src/mac/RootAccessibleWrap.mm

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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)
    22 {
    23 }
    25 RootAccessibleWrap::~RootAccessibleWrap()
    26 {
    27 }
    29 Class
    30 RootAccessibleWrap::GetNativeType()
    31 {
    32   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
    34   return [mozRootAccessible class];
    36   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
    37 }
    39 void
    40 RootAccessibleWrap::GetNativeWidget(void** aOutView)
    41 {
    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   }
    54 }

mercurial