1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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/. */
5 #ifndef __nsLookAndFeel
6 #define __nsLookAndFeel
7 
8 #include "nsXPLookAndFeel.h"
9 #include "AndroidBridge.h"
10 
11 class nsLookAndFeel final : public nsXPLookAndFeel {
12  public:
13   explicit nsLookAndFeel();
14   virtual ~nsLookAndFeel();
15 
16   void NativeInit() final;
17   virtual void RefreshImpl() override;
18   nsresult NativeGetInt(IntID, int32_t& aResult) override;
19   nsresult NativeGetFloat(FloatID, float& aResult) override;
20   nsresult NativeGetColor(ColorID, ColorScheme, nscolor& aResult) override;
21   bool NativeGetFont(FontID aID, nsString& aName,
22                      gfxFontStyle& aStyle) override;
23   virtual bool GetEchoPasswordImpl() override;
24   virtual uint32_t GetPasswordMaskDelayImpl() override;
25   virtual char16_t GetPasswordCharacterImpl() override;
26 
27  protected:
28   bool mInitializedSystemColors = false;
29   mozilla::AndroidSystemColors mSystemColors;
30   bool mInitializedShowPassword = false;
31   bool mShowPassword = false;
32 
33   nsresult GetSystemColors();
34 
35   void EnsureInitSystemColors();
36   void EnsureInitShowPassword();
37 };
38 
39 #endif
40