Bug 1731274 [wpt PR 30792] - Add WebIDL.idl as a dependency for webtransport idlharne...
[gecko.git] / dom / xul / ChromeObserver.h
blob2be0b7e78c5e7d43619eb1526ea6dc15132411f5
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_ChromeObserver_h
8 #define mozilla_dom_ChromeObserver_h
10 #include "nsStubMutationObserver.h"
12 class nsIWidget;
14 namespace mozilla {
15 namespace dom {
16 class Document;
18 class ChromeObserver final : public nsStubMutationObserver {
19 public:
20 NS_DECL_ISUPPORTS
22 explicit ChromeObserver(Document* aDocument);
23 void Init();
25 NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
26 NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
28 protected:
29 nsIWidget* GetWindowWidget();
30 void SetDrawsInTitlebar(bool aState);
31 void SetDrawsTitle(bool aState);
32 void SetChromeMargins(const nsAttrValue* aValue);
33 nsresult HideWindowChrome(bool aShouldHide);
35 private:
36 void ResetChromeMargins();
37 ~ChromeObserver();
38 // A weak pointer cleared when the element will be destroyed.
39 Document* MOZ_NON_OWNING_REF mDocument;
42 } // namespace dom
43 } // namespace mozilla
45 #endif // mozilla_dom_ChromeObserver_h