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.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | |
michael@0 | 7 | /* |
michael@0 | 8 | |
michael@0 | 9 | This is the focus manager for XUL documents. |
michael@0 | 10 | |
michael@0 | 11 | */ |
michael@0 | 12 | |
michael@0 | 13 | #ifndef nsXULCommandDispatcher_h__ |
michael@0 | 14 | #define nsXULCommandDispatcher_h__ |
michael@0 | 15 | |
michael@0 | 16 | #include "nsCOMPtr.h" |
michael@0 | 17 | #include "nsIDOMXULCommandDispatcher.h" |
michael@0 | 18 | #include "nsWeakReference.h" |
michael@0 | 19 | #include "nsIDOMNode.h" |
michael@0 | 20 | #include "nsString.h" |
michael@0 | 21 | #include "nsCycleCollectionParticipant.h" |
michael@0 | 22 | |
michael@0 | 23 | class nsIDOMElement; |
michael@0 | 24 | class nsPIWindowRoot; |
michael@0 | 25 | |
michael@0 | 26 | class nsXULCommandDispatcher : public nsIDOMXULCommandDispatcher, |
michael@0 | 27 | public nsSupportsWeakReference |
michael@0 | 28 | { |
michael@0 | 29 | public: |
michael@0 | 30 | nsXULCommandDispatcher(nsIDocument* aDocument); |
michael@0 | 31 | virtual ~nsXULCommandDispatcher(); |
michael@0 | 32 | |
michael@0 | 33 | // nsISupports |
michael@0 | 34 | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
michael@0 | 35 | NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULCommandDispatcher, |
michael@0 | 36 | nsIDOMXULCommandDispatcher) |
michael@0 | 37 | |
michael@0 | 38 | // nsIDOMXULCommandDispatcher interface |
michael@0 | 39 | NS_DECL_NSIDOMXULCOMMANDDISPATCHER |
michael@0 | 40 | |
michael@0 | 41 | void Disconnect(); |
michael@0 | 42 | protected: |
michael@0 | 43 | already_AddRefed<nsPIWindowRoot> GetWindowRoot(); |
michael@0 | 44 | |
michael@0 | 45 | nsIContent* GetRootFocusedContentAndWindow(nsPIDOMWindow** aWindow); |
michael@0 | 46 | |
michael@0 | 47 | nsCOMPtr<nsIDocument> mDocument; |
michael@0 | 48 | |
michael@0 | 49 | class Updater { |
michael@0 | 50 | public: |
michael@0 | 51 | Updater(nsIDOMElement* aElement, |
michael@0 | 52 | const nsAString& aEvents, |
michael@0 | 53 | const nsAString& aTargets) |
michael@0 | 54 | : mElement(aElement), |
michael@0 | 55 | mEvents(aEvents), |
michael@0 | 56 | mTargets(aTargets), |
michael@0 | 57 | mNext(nullptr) |
michael@0 | 58 | {} |
michael@0 | 59 | |
michael@0 | 60 | nsCOMPtr<nsIDOMElement> mElement; |
michael@0 | 61 | nsString mEvents; |
michael@0 | 62 | nsString mTargets; |
michael@0 | 63 | Updater* mNext; |
michael@0 | 64 | }; |
michael@0 | 65 | |
michael@0 | 66 | Updater* mUpdaters; |
michael@0 | 67 | |
michael@0 | 68 | bool Matches(const nsString& aList, |
michael@0 | 69 | const nsAString& aElement); |
michael@0 | 70 | }; |
michael@0 | 71 | |
michael@0 | 72 | #endif // nsXULCommandDispatcher_h__ |