Wed, 31 Dec 2014 06:09:35 +0100
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: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/. */
7 /*
9 This is the focus manager for XUL documents.
11 */
13 #ifndef nsXULCommandDispatcher_h__
14 #define nsXULCommandDispatcher_h__
16 #include "nsCOMPtr.h"
17 #include "nsIDOMXULCommandDispatcher.h"
18 #include "nsWeakReference.h"
19 #include "nsIDOMNode.h"
20 #include "nsString.h"
21 #include "nsCycleCollectionParticipant.h"
23 class nsIDOMElement;
24 class nsPIWindowRoot;
26 class nsXULCommandDispatcher : public nsIDOMXULCommandDispatcher,
27 public nsSupportsWeakReference
28 {
29 public:
30 nsXULCommandDispatcher(nsIDocument* aDocument);
31 virtual ~nsXULCommandDispatcher();
33 // nsISupports
34 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
35 NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULCommandDispatcher,
36 nsIDOMXULCommandDispatcher)
38 // nsIDOMXULCommandDispatcher interface
39 NS_DECL_NSIDOMXULCOMMANDDISPATCHER
41 void Disconnect();
42 protected:
43 already_AddRefed<nsPIWindowRoot> GetWindowRoot();
45 nsIContent* GetRootFocusedContentAndWindow(nsPIDOMWindow** aWindow);
47 nsCOMPtr<nsIDocument> mDocument;
49 class Updater {
50 public:
51 Updater(nsIDOMElement* aElement,
52 const nsAString& aEvents,
53 const nsAString& aTargets)
54 : mElement(aElement),
55 mEvents(aEvents),
56 mTargets(aTargets),
57 mNext(nullptr)
58 {}
60 nsCOMPtr<nsIDOMElement> mElement;
61 nsString mEvents;
62 nsString mTargets;
63 Updater* mNext;
64 };
66 Updater* mUpdaters;
68 bool Matches(const nsString& aList,
69 const nsAString& aElement);
70 };
72 #endif // nsXULCommandDispatcher_h__