Bug 1538144 [wpt PR 15985] - Add tests for pixel-snapping under 3d transform, a=testonly
[gecko.git] / chrome / nsChromeRegistryContent.h
blobd10af538a8375f09be8e4b670fc17e6eef51a86d
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 CheckForOSAccessibility() override;
30 NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic,
31 const char16_t* aData) override;
32 NS_IMETHOD IsLocaleRTL(const nsACString& package, bool* aResult) override;
33 NS_IMETHOD GetSelectedLocale(const nsACString& aPackage, bool aAsBCP47,
34 nsACString& aLocale) override;
36 void RegisterPackage(const ChromePackage& aPackage);
37 void RegisterOverride(const OverrideMapping& aOverride);
38 void RegisterSubstitution(const SubstitutionMapping& aResource);
40 private:
41 struct PackageEntry {
42 PackageEntry() : flags(0) {}
43 ~PackageEntry() {}
45 nsCOMPtr<nsIURI> contentBaseURI;
46 nsCOMPtr<nsIURI> localeBaseURI;
47 nsCOMPtr<nsIURI> skinBaseURI;
48 uint32_t flags;
51 nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
52 const nsCString& aProvider,
53 const nsCString& aPath) override;
54 nsresult GetFlagsFromPackage(const nsCString& aPackage,
55 uint32_t* aFlags) override;
57 nsClassHashtable<nsCStringHashKey, PackageEntry> mPackagesHash;
58 nsCString mLocale;
60 virtual void ManifestContent(ManifestProcessingContext& cx, int lineno,
61 char* const* argv, int flags) override;
62 virtual void ManifestLocale(ManifestProcessingContext& cx, int lineno,
63 char* const* argv, int flags) override;
64 virtual void ManifestSkin(ManifestProcessingContext& cx, int lineno,
65 char* const* argv, int flags) override;
66 virtual void ManifestOverride(ManifestProcessingContext& cx, int lineno,
67 char* const* argv, int flags) override;
68 virtual void ManifestResource(ManifestProcessingContext& cx, int lineno,
69 char* const* argv, int flags) override;
72 #endif // nsChromeRegistryContent_h