From 69b76a336f9d2a66b7b85600eac812146d0f1bc0 Mon Sep 17 00:00:00 2001 From: Andrew Quartey Date: Sat, 11 Feb 2012 16:45:10 +0900 Subject: [PATCH] Bug 634829 - Remove nsIAccessibleWin32Object interface, r=surkov --- accessible/public/msaa/Makefile.in | 1 - .../public/msaa/nsIAccessibleWin32Object.idl | 46 ------------------- accessible/src/msaa/nsAccessibleWrap.cpp | 26 +++-------- .../src/msaa/nsHTMLWin32ObjectAccessible.cpp | 11 +++-- .../src/msaa/nsHTMLWin32ObjectAccessible.h | 7 ++- 5 files changed, 17 insertions(+), 74 deletions(-) delete mode 100644 accessible/public/msaa/nsIAccessibleWin32Object.idl diff --git a/accessible/public/msaa/Makefile.in b/accessible/public/msaa/Makefile.in index 8345019dd9f..29261531ba5 100644 --- a/accessible/public/msaa/Makefile.in +++ b/accessible/public/msaa/Makefile.in @@ -49,7 +49,6 @@ DEFFILE = $(win_srcdir)/AccessibleMarshal.def include $(DEPTH)/config/autoconf.mk XPIDLSRCS = \ - nsIAccessibleWin32Object.idl \ nsIWinAccessNode.idl \ $(NULL) diff --git a/accessible/public/msaa/nsIAccessibleWin32Object.idl b/accessible/public/msaa/nsIAccessibleWin32Object.idl deleted file mode 100644 index e5ba98393e6..00000000000 --- a/accessible/public/msaa/nsIAccessibleWin32Object.idl +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Mozilla browser. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1999 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsISupports.idl" - -[scriptable, uuid(ca7a3a93-822f-4cdf-8cb4-c52d16b9afc7)] -interface nsIAccessibleWin32Object : nsISupports -{ - /** handle to the external window implementing IAccessible */ - [noscript] readonly attribute voidPtr hwnd; -}; diff --git a/accessible/src/msaa/nsAccessibleWrap.cpp b/accessible/src/msaa/nsAccessibleWrap.cpp index 85c831a4e73..82822178493 100644 --- a/accessible/src/msaa/nsAccessibleWrap.cpp +++ b/accessible/src/msaa/nsAccessibleWrap.cpp @@ -50,7 +50,6 @@ #include "nsIAccessibleEvent.h" #include "nsIAccessibleRelation.h" -#include "nsIAccessibleWin32Object.h" #include "Accessible2_i.c" #include "AccessibleStates.h" @@ -1684,29 +1683,16 @@ nsAccessibleWrap::ConvertToIA2Attributes(nsIPersistentProperties *aAttributes, return *aIA2Attributes ? S_OK : E_OUTOFMEMORY; } -IDispatch *nsAccessibleWrap::NativeAccessible(nsIAccessible *aXPAccessible) +IDispatch* +nsAccessibleWrap::NativeAccessible(nsIAccessible* aAccessible) { - if (!aXPAccessible) { - NS_WARNING("Not passing in an aXPAccessible"); + if (!aAccessible) { + NS_WARNING("Not passing in an aAccessible"); return NULL; } - nsCOMPtr accObject(do_QueryInterface(aXPAccessible)); - if (accObject) { - void* hwnd = nsnull; - accObject->GetHwnd(&hwnd); - if (hwnd) { - IDispatch *retval = nsnull; - ::AccessibleObjectFromWindow(reinterpret_cast(hwnd), - OBJID_WINDOW, IID_IAccessible, - (void **) &retval); - return retval; - } - } - - IAccessible *msaaAccessible; - aXPAccessible->GetNativeInterface((void**)&msaaAccessible); - + IAccessible* msaaAccessible = nsnull; + aAccessible->GetNativeInterface(reinterpret_cast(&msaaAccessible)); return static_cast(msaaAccessible); } diff --git a/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp b/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp index 1a9a070d0fa..47eaef52fdc 100644 --- a/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp +++ b/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp @@ -114,11 +114,16 @@ nsLeafAccessible(nsnull, nsnull) } } -NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLWin32ObjectAccessible, nsAccessible, nsIAccessibleWin32Object) +NS_IMPL_ISUPPORTS_INHERITED0(nsHTMLWin32ObjectAccessible, nsAccessible) -NS_IMETHODIMP nsHTMLWin32ObjectAccessible::GetHwnd(void **aHwnd) +NS_IMETHODIMP +nsHTMLWin32ObjectAccessible::GetNativeInterface(void** aNativeAccessible) { - *aHwnd = mHwnd; + if (mHwnd) { + ::AccessibleObjectFromWindow(static_cast(mHwnd), + OBJID_WINDOW, IID_IAccessible, + aNativeAccessible); + } return NS_OK; } diff --git a/accessible/src/msaa/nsHTMLWin32ObjectAccessible.h b/accessible/src/msaa/nsHTMLWin32ObjectAccessible.h index dbb63264951..00b17ce750f 100644 --- a/accessible/src/msaa/nsHTMLWin32ObjectAccessible.h +++ b/accessible/src/msaa/nsHTMLWin32ObjectAccessible.h @@ -39,7 +39,6 @@ #ifndef _nsHTMLWin32ObjectAccessible_H_ #define _nsHTMLWin32ObjectAccessible_H_ -#include "nsIAccessibleWin32Object.h" #include "nsBaseWidgetAccessible.h" struct IAccessible; @@ -82,8 +81,7 @@ protected: * object returned by us in Accessible::NewAccessible() that gets the IAccessible * from the windows system from the window handle. */ -class nsHTMLWin32ObjectAccessible : public nsLeafAccessible, - public nsIAccessibleWin32Object +class nsHTMLWin32ObjectAccessible : public nsLeafAccessible { public: @@ -91,7 +89,8 @@ public: virtual ~nsHTMLWin32ObjectAccessible() {} NS_DECL_ISUPPORTS_INHERITED - NS_DECL_NSIACCESSIBLEWIN32OBJECT + + NS_IMETHOD GetNativeInterface(void** aNativeAccessible) MOZ_OVERRIDE; protected: void* mHwnd;