Bug 1491795 [wpt PR 13028] - HTML: test fieldset with percentage padding, a=testonly
[gecko.git] / chrome / nsChromeRegistryContent.h
blob33570069c3fb1ca00ddcb2ba1eef4d9f37330063
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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/. */
6 #ifndef nsChromeRegistryContent_h
7 #define nsChromeRegistryContent_h
9 #include "nsChromeRegistry.h"
10 #include "nsClassHashtable.h"
12 struct ChromePackage;
13 struct SubstitutionMapping;
14 struct OverrideMapping;
16 class nsChromeRegistryContent : public nsChromeRegistry
18 public:
19 nsChromeRegistryContent();
21 void RegisterRemoteChrome(const InfallibleTArray<ChromePackage>& aPackages,
22 const InfallibleTArray<SubstitutionMapping>& aResources,
23 const InfallibleTArray<OverrideMapping>& aOverrides,
24 const nsACString& aLocale,
25 bool aReset);
27 NS_IMETHOD GetLocalesForPackage(const nsACString& aPackage,
28 nsIUTF8StringEnumerator* *aResult) override;
29 NS_IMETHOD CheckForNewChrome() override;
30 NS_IMETHOD CheckForOSAccessibility() override;
31 NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic,
32 const char16_t* aData) override;
33 NS_IMETHOD IsLocaleRTL(const nsACString& package,
34 bool *aResult) override;
35 NS_IMETHOD GetSelectedLocale(const nsACString& aPackage,
36 bool aAsBCP47,
37 nsACString& aLocale) override;
39 void RegisterPackage(const ChromePackage& aPackage);
40 void RegisterOverride(const OverrideMapping& aOverride);
41 void RegisterSubstitution(const SubstitutionMapping& aResource);
43 private:
44 struct PackageEntry
46 PackageEntry() : flags(0) { }
47 ~PackageEntry() { }
49 nsCOMPtr<nsIURI> contentBaseURI;
50 nsCOMPtr<nsIURI> localeBaseURI;
51 nsCOMPtr<nsIURI> skinBaseURI;
52 uint32_t flags;
55 nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
56 const nsCString& aProvider,
57 const nsCString& aPath) override;
58 nsresult GetFlagsFromPackage(const nsCString& aPackage, uint32_t* aFlags) override;
60 nsClassHashtable<nsCStringHashKey, PackageEntry> mPackagesHash;
61 nsCString mLocale;
63 virtual void ManifestContent(ManifestProcessingContext& cx, int lineno,
64 char *const * argv, int flags) override;
65 virtual void ManifestLocale(ManifestProcessingContext& cx, int lineno,
66 char *const * argv, int flags) override;
67 virtual void ManifestSkin(ManifestProcessingContext& cx, int lineno,
68 char *const * argv, int flags) override;
69 virtual void ManifestOverride(ManifestProcessingContext& cx, int lineno,
70 char *const * argv, int flags) override;
71 virtual void ManifestResource(ManifestProcessingContext& cx, int lineno,
72 char *const * argv, int flags) override;
75 #endif // nsChromeRegistryContent_h