Bug 1462329 [wpt PR 10991] - Server-Timing: test TAO:* for cross-origin resource...
[gecko.git] / widget / headless / HeadlessLookAndFeel.h
blob6a8af92cfd94a515644dc862ab1a6f8dafd62543
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_widget_HeadlessLookAndFeel_h
8 #define mozilla_widget_HeadlessLookAndFeel_h
10 #include "nsXPLookAndFeel.h"
11 #include "nsLookAndFeel.h"
13 namespace mozilla {
14 namespace widget {
16 #if defined(MOZ_WIDGET_GTK)
18 // Our nsLookAndFeel for GTK relies on APIs that aren't available in headless
19 // mode, so we use an implementation with hardcoded values.
21 class HeadlessLookAndFeel: public nsXPLookAndFeel {
22 public:
23 HeadlessLookAndFeel();
24 virtual ~HeadlessLookAndFeel();
26 virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult) override;
27 void NativeInit() final {};
28 virtual nsresult GetIntImpl(IntID aID, int32_t &aResult) override;
29 virtual nsresult GetFloatImpl(FloatID aID, float &aResult) override;
30 virtual bool GetFontImpl(FontID aID,
31 nsString& aFontName,
32 gfxFontStyle& aFontStyle,
33 float aDevPixPerCSSPixel) override;
35 virtual void RefreshImpl() override;
36 virtual char16_t GetPasswordCharacterImpl() override;
37 virtual bool GetEchoPasswordImpl() override;
40 #else
42 // When possible, we simply reuse the platform's existing nsLookAndFeel
43 // implementation in headless mode.
45 typedef nsLookAndFeel HeadlessLookAndFeel;
47 #endif
49 } // namespace widget
50 } // namespace mozilla
52 #endif