2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*-
|
2018-08-14 10:38:03 +03:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2018-09-15 13:03:29 +03:00
|
|
|
#ifndef GeckoSystemStateListener_h
|
|
|
|
#define GeckoSystemStateListener_h
|
2018-08-14 10:38:03 +03:00
|
|
|
|
2019-03-29 18:12:47 +03:00
|
|
|
#include "mozilla/Assertions.h"
|
2020-05-23 02:03:43 +03:00
|
|
|
#include "mozilla/LookAndFeel.h"
|
2020-05-15 20:04:10 +03:00
|
|
|
#include "mozilla/java/GeckoSystemStateListenerNatives.h"
|
2018-08-14 10:38:03 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2018-09-15 13:03:29 +03:00
|
|
|
class GeckoSystemStateListener final
|
|
|
|
: public java::GeckoSystemStateListener::Natives<GeckoSystemStateListener> {
|
|
|
|
GeckoSystemStateListener() = delete;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2018-08-14 10:38:03 +03:00
|
|
|
public:
|
|
|
|
static void OnDeviceChanged() {
|
|
|
|
MOZ_ASSERT(NS_IsMainThread());
|
2020-10-27 13:24:40 +03:00
|
|
|
// TODO(emilio, bug 1673318): This could become more granular and avoid work
|
|
|
|
// if we get whether these are layout/style-affecting from the caller.
|
|
|
|
mozilla::LookAndFeel::NotifyChangedAllWindows(
|
|
|
|
widget::ThemeChangeKind::StyleAndLayout);
|
2018-11-30 13:46:48 +03:00
|
|
|
}
|
2018-08-14 10:38:03 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2018-09-15 13:03:29 +03:00
|
|
|
#endif // GeckoSystemStateListener_h
|