Bug 1692596 - Fix include-what-you-use errors in widget/windows/ScrollbarUtils.{h,cpp}. r=emilio

Also avoid including nsLayoutUtils.h from a header file.

Differential Revision: https://phabricator.services.mozilla.com/D105071
This commit is contained in:
Botond Ballo 2021-02-12 23:54:30 +00:00
Родитель 7de7e91542
Коммит 55d1d2d099
2 изменённых файлов: 21 добавлений и 8 удалений

Просмотреть файл

@ -5,11 +5,24 @@
#include "ScrollbarUtil.h"
#include "mozilla/Maybe.h"
#include "mozilla/RelativeLuminanceUtils.h"
#include "mozilla/StaticPrefs_widget.h"
#include "nsLayoutUtils.h"
#include "nsNativeTheme.h"
#include "nsNativeBasicTheme.h"
using mozilla::ComputedStyle;
using mozilla::EventStates;
using mozilla::Maybe;
using mozilla::Nothing;
using mozilla::RelativeLuminanceUtils;
using mozilla::Some;
using mozilla::StyleAppearance;
using mozilla::StyleScrollbarWidth;
namespace StaticPrefs = mozilla::StaticPrefs;
/*static*/
bool ScrollbarUtil::IsScrollbarWidthThin(ComputedStyle* aStyle) {
auto scrollbarWidth = aStyle->StyleUIReset()->mScrollbarWidth;

Просмотреть файл

@ -6,12 +6,12 @@
#ifndef ScrollbarUtil_h
#define ScrollbarUtil_h
#include "nsLayoutUtils.h"
#include "nsITheme.h"
#include "nsNativeTheme.h"
class ScrollbarUtil {
public:
static bool IsScrollbarWidthThin(ComputedStyle* aStyle);
static bool IsScrollbarWidthThin(mozilla::ComputedStyle* aStyle);
static bool IsScrollbarWidthThin(nsIFrame* aFrame);
// Returns the style for custom scrollbar if the scrollbar part frame should
@ -19,17 +19,17 @@ class ScrollbarUtil {
//
// Optionally the caller can pass a pointer to aDarkScrollbar for whether
// custom scrollbar may be drawn due to dark background.
static ComputedStyle* GetCustomScrollbarStyle(nsIFrame* aFrame,
bool* aDarkScrollbar = nullptr);
static mozilla::ComputedStyle* GetCustomScrollbarStyle(
nsIFrame* aFrame, bool* aDarkScrollbar = nullptr);
static nscolor GetScrollbarButtonColor(nscolor aTrackColor,
EventStates aStates);
mozilla::EventStates aStates);
static nscolor GetScrollbarArrowColor(nscolor aButtonColor);
static nscolor GetScrollbarTrackColor(nsIFrame* aFrame);
static nscolor GetScrollbarThumbColor(nsIFrame* aFrame,
EventStates aEventStates);
static Maybe<nsITheme::Transparency> GetScrollbarPartTransparency(
nsIFrame* aFrame, StyleAppearance aAppearance);
mozilla::EventStates aEventStates);
static mozilla::Maybe<nsITheme::Transparency> GetScrollbarPartTransparency(
nsIFrame* aFrame, mozilla::StyleAppearance aAppearance);
protected:
ScrollbarUtil() = default;