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 "XULMenuAccessibleWrap.h" michael@0: #include "nsNameSpaceManager.h" michael@0: michael@0: using namespace mozilla::a11y; michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: // XULMenuAccessibleWrap michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: XULMenuitemAccessibleWrap:: michael@0: XULMenuitemAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) : michael@0: XULMenuitemAccessible(aContent, aDoc) michael@0: { michael@0: } michael@0: michael@0: ENameValueFlag michael@0: XULMenuitemAccessibleWrap::Name(nsString& aName) michael@0: { michael@0: // XXX This should be done in get_accName() so that nsIAccessible::GetName()] michael@0: // provides the same results on all platforms michael@0: XULMenuitemAccessible::Name(aName); michael@0: if (aName.IsEmpty()) michael@0: return eNameOK; michael@0: michael@0: nsAutoString accel; michael@0: mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::acceltext, accel); michael@0: if (!accel.IsEmpty()) michael@0: aName += NS_LITERAL_STRING("\t") + accel; michael@0: michael@0: return eNameOK; michael@0: }