Bug 1529445 [wpt PR 15111] - Fix #12696: make property_order default to empty list...
[gecko.git] / chrome / nsChromeRegistryContent.h
blob6b09633f7a7fcb9d0eb73e5325d2b1a45ef392e0
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 {
17 public:
18 nsChromeRegistryContent();
20 void RegisterRemoteChrome(
21 const InfallibleTArray<ChromePackage>& aPackages,
22 const InfallibleTArray<SubstitutionMapping>& aResources,
23 const InfallibleTArray<OverrideMapping>& aOverrides,
24 const nsACString& aLocale, bool aReset);
26 NS_IMETHOD GetLocalesForPackage(const nsACString& aPackage,
27 nsIUTF8StringEnumerator** aResult) override;
28 NS_IMETHOD CheckForNewChrome() override;
29 NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic,
30 const char16_t* aData) override;
31 NS_IMETHOD IsLocaleRTL(const nsACString& package, bool* aResult) override;
32 NS_IMETHOD GetSelectedLocale(const nsACString& aPackage, bool aAsBCP47,
33 nsACString& aLocale) override;
35 void RegisterPackage(const ChromePackage& aPackage);
36 void RegisterOverride(const OverrideMapping& aOverride);
37 void RegisterSubstitution(const SubstitutionMapping& aResource);
39 private:
40 struct PackageEntry {
41 PackageEntry() : flags(0) {}
42 ~PackageEntry() {}
44 nsCOMPtr<nsIURI> contentBaseURI;
45 nsCOMPtr<nsIURI> localeBaseURI;
46 nsCOMPtr<nsIURI> skinBaseURI;
47 uint32_t flags;
50 nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
51 const nsCString& aProvider,
52 const nsCString& aPath) override;
53 nsresult GetFlagsFromPackage(const nsCString& aPackage,
54 uint32_t* aFlags) override;
56 nsClassHashtable<nsCStringHashKey, PackageEntry> mPackagesHash;
57 nsCString mLocale;
59 virtual void ManifestContent(ManifestProcessingContext& cx, int lineno,
60 char* const* argv, int flags) override;
61 virtual void ManifestLocale(ManifestProcessingContext& cx, int lineno,
62 char* const* argv, int flags) override;
63 virtual void ManifestSkin(ManifestProcessingContext& cx, int lineno,
64 char* const* argv, int flags) override;
65 virtual void ManifestOverride(ManifestProcessingContext& cx, int lineno,
66 char* const* argv, int flags) override;
67 virtual void ManifestResource(ManifestProcessingContext& cx, int lineno,
68 char* const* argv, int flags) override;
71 #endif // nsChromeRegistryContent_h