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: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
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 | #ifndef nsChromeRegistryContent_h |
michael@0 | 7 | #define nsChromeRegistryContent_h |
michael@0 | 8 | |
michael@0 | 9 | #include "nsChromeRegistry.h" |
michael@0 | 10 | #include "nsClassHashtable.h" |
michael@0 | 11 | |
michael@0 | 12 | struct ChromePackage; |
michael@0 | 13 | struct ResourceMapping; |
michael@0 | 14 | struct OverrideMapping; |
michael@0 | 15 | |
michael@0 | 16 | class nsChromeRegistryContent : public nsChromeRegistry |
michael@0 | 17 | { |
michael@0 | 18 | public: |
michael@0 | 19 | nsChromeRegistryContent(); |
michael@0 | 20 | |
michael@0 | 21 | void RegisterRemoteChrome(const InfallibleTArray<ChromePackage>& aPackages, |
michael@0 | 22 | const InfallibleTArray<ResourceMapping>& aResources, |
michael@0 | 23 | const InfallibleTArray<OverrideMapping>& aOverrides, |
michael@0 | 24 | const nsACString& aLocale); |
michael@0 | 25 | |
michael@0 | 26 | NS_IMETHOD GetLocalesForPackage(const nsACString& aPackage, |
michael@0 | 27 | nsIUTF8StringEnumerator* *aResult) MOZ_OVERRIDE; |
michael@0 | 28 | NS_IMETHOD CheckForNewChrome() MOZ_OVERRIDE; |
michael@0 | 29 | NS_IMETHOD CheckForOSAccessibility() MOZ_OVERRIDE; |
michael@0 | 30 | NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic, |
michael@0 | 31 | const char16_t* aData) MOZ_OVERRIDE; |
michael@0 | 32 | NS_IMETHOD IsLocaleRTL(const nsACString& package, |
michael@0 | 33 | bool *aResult) MOZ_OVERRIDE; |
michael@0 | 34 | NS_IMETHOD GetSelectedLocale(const nsACString& aPackage, |
michael@0 | 35 | nsACString& aLocale) MOZ_OVERRIDE; |
michael@0 | 36 | NS_IMETHOD GetStyleOverlays(nsIURI *aChromeURL, |
michael@0 | 37 | nsISimpleEnumerator **aResult) MOZ_OVERRIDE; |
michael@0 | 38 | NS_IMETHOD GetXULOverlays(nsIURI *aChromeURL, |
michael@0 | 39 | nsISimpleEnumerator **aResult) MOZ_OVERRIDE; |
michael@0 | 40 | |
michael@0 | 41 | private: |
michael@0 | 42 | struct PackageEntry |
michael@0 | 43 | { |
michael@0 | 44 | PackageEntry() : flags(0) { } |
michael@0 | 45 | ~PackageEntry() { } |
michael@0 | 46 | |
michael@0 | 47 | nsCOMPtr<nsIURI> contentBaseURI; |
michael@0 | 48 | nsCOMPtr<nsIURI> localeBaseURI; |
michael@0 | 49 | nsCOMPtr<nsIURI> skinBaseURI; |
michael@0 | 50 | uint32_t flags; |
michael@0 | 51 | }; |
michael@0 | 52 | |
michael@0 | 53 | void RegisterPackage(const ChromePackage& aPackage); |
michael@0 | 54 | void RegisterResource(const ResourceMapping& aResource); |
michael@0 | 55 | void RegisterOverride(const OverrideMapping& aOverride); |
michael@0 | 56 | |
michael@0 | 57 | nsresult UpdateSelectedLocale() MOZ_OVERRIDE; |
michael@0 | 58 | nsIURI* GetBaseURIFromPackage(const nsCString& aPackage, |
michael@0 | 59 | const nsCString& aProvider, |
michael@0 | 60 | const nsCString& aPath) MOZ_OVERRIDE; |
michael@0 | 61 | nsresult GetFlagsFromPackage(const nsCString& aPackage, uint32_t* aFlags) MOZ_OVERRIDE; |
michael@0 | 62 | |
michael@0 | 63 | nsClassHashtable<nsCStringHashKey, PackageEntry> mPackagesHash; |
michael@0 | 64 | nsCString mLocale; |
michael@0 | 65 | |
michael@0 | 66 | virtual void ManifestContent(ManifestProcessingContext& cx, int lineno, |
michael@0 | 67 | char *const * argv, bool platform, |
michael@0 | 68 | bool contentaccessible); |
michael@0 | 69 | virtual void ManifestLocale(ManifestProcessingContext& cx, int lineno, |
michael@0 | 70 | char *const * argv, bool platform, |
michael@0 | 71 | bool contentaccessible); |
michael@0 | 72 | virtual void ManifestSkin(ManifestProcessingContext& cx, int lineno, |
michael@0 | 73 | char *const * argv, bool platform, |
michael@0 | 74 | bool contentaccessible); |
michael@0 | 75 | virtual void ManifestOverlay(ManifestProcessingContext& cx, int lineno, |
michael@0 | 76 | char *const * argv, bool platform, |
michael@0 | 77 | bool contentaccessible); |
michael@0 | 78 | virtual void ManifestStyle(ManifestProcessingContext& cx, int lineno, |
michael@0 | 79 | char *const * argv, bool platform, |
michael@0 | 80 | bool contentaccessible); |
michael@0 | 81 | virtual void ManifestOverride(ManifestProcessingContext& cx, int lineno, |
michael@0 | 82 | char *const * argv, bool platform, |
michael@0 | 83 | bool contentaccessible); |
michael@0 | 84 | virtual void ManifestResource(ManifestProcessingContext& cx, int lineno, |
michael@0 | 85 | char *const * argv, bool platform, |
michael@0 | 86 | bool contentaccessible); |
michael@0 | 87 | }; |
michael@0 | 88 | |
michael@0 | 89 | #endif // nsChromeRegistryContent_h |