Bug 1716846 [wpt PR 29402] - Update wpt metadata, a=testonly
[gecko.git] / widget / android / GeckoSystemStateListener.h
blob75cb1cd9fe188fb3378f85f8c47b3f18d8cf903e
1 /* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*-
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 GeckoSystemStateListener_h
7 #define GeckoSystemStateListener_h
9 #include "mozilla/Assertions.h"
10 #include "mozilla/LookAndFeel.h"
11 #include "mozilla/java/GeckoSystemStateListenerNatives.h"
13 namespace mozilla {
15 class GeckoSystemStateListener final
16 : public java::GeckoSystemStateListener::Natives<GeckoSystemStateListener> {
17 GeckoSystemStateListener() = delete;
19 public:
20 static void OnDeviceChanged() {
21 MOZ_ASSERT(NS_IsMainThread());
22 // TODO(emilio, bug 1673318): This could become more granular and avoid work
23 // if we get whether these are layout/style-affecting from the caller.
24 mozilla::LookAndFeel::NotifyChangedAllWindows(
25 widget::ThemeChangeKind::StyleAndLayout);
29 } // namespace mozilla
31 #endif // GeckoSystemStateListener_h