Backed out changeset 7b83373f7a9e (bug 1883860) for causing build bustages @ caps...
[gecko.git] / dom / xul / ChromeObserver.h
blobc651389487b89d2e98b924143240ce82a86e61ff
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::dom {
15 class Document;
17 class ChromeObserver final : public nsStubMutationObserver {
18 public:
19 NS_DECL_ISUPPORTS
21 explicit ChromeObserver(Document* aDocument);
22 void Init();
24 NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
25 NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
27 protected:
28 nsIWidget* GetWindowWidget();
29 void SetDrawsTitle(bool aState);
30 void SetChromeMargins(const nsAttrValue* aValue);
31 nsresult HideWindowChrome(bool aShouldHide);
33 private:
34 void ResetChromeMargins();
35 ~ChromeObserver();
36 // A weak pointer cleared when the element will be destroyed.
37 Document* MOZ_NON_OWNING_REF mDocument;
40 } // namespace mozilla::dom
42 #endif // mozilla_dom_ChromeObserver_h