1 /* -*- Mode: C++; tab-width: 40; 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 
6 #include "nsNativeBasicThemeWin.h"
7 
8 #include "mozilla/ClearOnShutdown.h"
9 #include "ScrollbarUtil.h"
10 
GetWidgetTransparency(nsIFrame * aFrame,StyleAppearance aAppearance)11 nsITheme::Transparency nsNativeBasicThemeWin::GetWidgetTransparency(
12     nsIFrame* aFrame, StyleAppearance aAppearance) {
13   if (auto transparency =
14           ScrollbarUtil::GetScrollbarPartTransparency(aFrame, aAppearance)) {
15     return *transparency;
16   }
17   return nsNativeBasicTheme::GetWidgetTransparency(aFrame, aAppearance);
18 }
19 
do_GetBasicNativeThemeDoNotUseDirectly()20 already_AddRefed<nsITheme> do_GetBasicNativeThemeDoNotUseDirectly() {
21   static mozilla::StaticRefPtr<nsITheme> gInstance;
22   if (MOZ_UNLIKELY(!gInstance)) {
23     gInstance = new nsNativeBasicThemeWin();
24     ClearOnShutdown(&gInstance);
25   }
26   return do_AddRef(gInstance);
27 }
28