зеркало из https://github.com/mozilla/gecko-dev.git
Bug 196644 get rid of class nsMenuListenerAccessible
r=aaronl, sr=henry.jia
This commit is contained in:
Родитель
8b1c66be8e
Коммит
6d3853b279
|
@ -383,73 +383,3 @@ PRBool nsLinkableAccessible::IsALink()
|
|||
mIsALinkCached = PR_TRUE; // Cached that there is no link
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
// ------------
|
||||
// nsMenuListenerAccessible
|
||||
// ------------
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsMenuListenerAccessible, nsAccessible, nsIDOMXULListener)
|
||||
|
||||
nsMenuListenerAccessible::nsMenuListenerAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
|
||||
nsAccessible(aDOMNode, aShell)
|
||||
{
|
||||
mRegistered = PR_FALSE;
|
||||
mOpen = PR_FALSE;
|
||||
}
|
||||
|
||||
nsMenuListenerAccessible::~nsMenuListenerAccessible()
|
||||
{
|
||||
if (mRegistered) {
|
||||
nsCOMPtr<nsIDOMEventReceiver> eventReceiver(do_QueryInterface(mDOMNode));
|
||||
if (eventReceiver)
|
||||
eventReceiver->RemoveEventListener(NS_LITERAL_STRING("popupshowing"), this, PR_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMenuListenerAccessible::PopupShowing(nsIDOMEvent* aEvent)
|
||||
{
|
||||
mOpen = PR_TRUE;
|
||||
|
||||
/* TBD send state change event */
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMenuListenerAccessible::PopupHiding(nsIDOMEvent* aEvent)
|
||||
{
|
||||
mOpen = PR_FALSE;
|
||||
|
||||
/* TBD send state change event */
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMenuListenerAccessible::Close(nsIDOMEvent* aEvent)
|
||||
{
|
||||
mOpen = PR_FALSE;
|
||||
|
||||
/* TBD send state change event */
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsMenuListenerAccessible::SetupMenuListener()
|
||||
{
|
||||
// if not already one, register ourselves as a popup listener
|
||||
if (!mRegistered) {
|
||||
nsCOMPtr<nsIDOMEventReceiver> eventReceiver(do_QueryInterface(mDOMNode));
|
||||
if (!eventReceiver) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsresult rv = eventReceiver->AddEventListener(NS_LITERAL_STRING("popupshowing"), this, PR_TRUE);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
return;
|
||||
}
|
||||
|
||||
mRegistered = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -114,37 +114,5 @@ protected:
|
|||
PRBool mIsLinkVisited;
|
||||
};
|
||||
|
||||
/*
|
||||
* A base class that can listen to menu events. Its used by selects so the
|
||||
* button and the window accessibles can change their name and role
|
||||
* depending on whether the drop down list is dropped down on not
|
||||
*/
|
||||
class nsMenuListenerAccessible : public nsAccessible, public nsIDOMXULListener
|
||||
{
|
||||
public:
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
nsMenuListenerAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
|
||||
virtual ~nsMenuListenerAccessible();
|
||||
|
||||
// popup listener
|
||||
NS_IMETHOD PopupShowing(nsIDOMEvent* aEvent);
|
||||
NS_IMETHOD PopupShown(nsIDOMEvent* aEvent) { return NS_OK; }
|
||||
NS_IMETHOD PopupHiding(nsIDOMEvent* aEvent);
|
||||
NS_IMETHOD PopupHidden(nsIDOMEvent* aEvent) { return NS_OK; }
|
||||
|
||||
NS_IMETHOD Close(nsIDOMEvent* aEvent);
|
||||
NS_IMETHOD Command(nsIDOMEvent* aEvent) { return NS_OK; }
|
||||
NS_IMETHOD Broadcast(nsIDOMEvent* aEvent) { return NS_OK; }
|
||||
NS_IMETHOD CommandUpdate(nsIDOMEvent* aEvent) { return NS_OK; }
|
||||
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; }
|
||||
|
||||
virtual void SetupMenuListener();
|
||||
|
||||
PRBool mRegistered;
|
||||
PRBool mOpen;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче