Bug 1468402 - Part 3: Add test for subgrids in the grid list. r=pbro
[gecko.git] / layout / base / ZoomConstraintsClient.h
bloba6a488c78b8f5964f4863a14413d77274600cc2a
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 ZoomConstraintsClient_h_
8 #define ZoomConstraintsClient_h_
10 #include "mozilla/layers/ScrollableLayerGuid.h"
11 #include "mozilla/Maybe.h"
12 #include "nsCOMPtr.h"
13 #include "nsIDOMEventListener.h"
14 #include "nsIObserver.h"
16 namespace mozilla {
17 class PresShell;
18 namespace dom {
19 class EventTarget;
20 } // namespace dom
21 } // namespace mozilla
23 class ZoomConstraintsClient final : public nsIDOMEventListener,
24 public nsIObserver {
25 public:
26 NS_DECL_ISUPPORTS
27 NS_DECL_NSIDOMEVENTLISTENER
28 NS_DECL_NSIOBSERVER
30 ZoomConstraintsClient();
32 private:
33 ~ZoomConstraintsClient();
35 public:
36 void Init(mozilla::PresShell* aPresShell, mozilla::dom::Document* aDocument);
37 void Destroy();
38 void ScreenSizeChanged();
40 private:
41 void RefreshZoomConstraints();
43 RefPtr<mozilla::dom::Document> mDocument;
44 // raw ref since the presShell owns this
45 mozilla::PresShell* MOZ_NON_OWNING_REF mPresShell;
46 nsCOMPtr<mozilla::dom::EventTarget> mEventTarget;
47 mozilla::Maybe<mozilla::layers::ScrollableLayerGuid> mGuid;
50 #endif