зеркало из https://github.com/mozilla/pjs.git
Re-add logic for bug 239914: use the classic skin when OS accessibility is enabled, because it obeys system colors and preferences.
This commit is contained in:
Родитель
c4bfd42e34
Коммит
1cba5e2e5e
|
@ -71,6 +71,7 @@
|
||||||
#include "nsIExtensionManager.h"
|
#include "nsIExtensionManager.h"
|
||||||
#include "nsIIOService.h"
|
#include "nsIIOService.h"
|
||||||
#include "nsILocaleService.h"
|
#include "nsILocaleService.h"
|
||||||
|
#include "nsILookAndFeel.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsINativeAppSupport.h"
|
#include "nsINativeAppSupport.h"
|
||||||
#include "nsIPref.h"
|
#include "nsIPref.h"
|
||||||
|
@ -88,6 +89,7 @@
|
||||||
#include "nsCRT.h"
|
#include "nsCRT.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
|
#include "nsWidgetsCID.h"
|
||||||
#include "nsXPCOM.h"
|
#include "nsXPCOM.h"
|
||||||
#include "nsXPIDLString.h"
|
#include "nsXPIDLString.h"
|
||||||
|
|
||||||
|
@ -867,6 +869,7 @@ public:
|
||||||
nsresult RegisterProfileService(nsIToolkitProfileService* aProfileService);
|
nsresult RegisterProfileService(nsIToolkitProfileService* aProfileService);
|
||||||
nsresult InitEventQueue();
|
nsresult InitEventQueue();
|
||||||
nsresult SetWindowCreator(nsINativeAppSupport* native);
|
nsresult SetWindowCreator(nsINativeAppSupport* native);
|
||||||
|
void CheckAccessibleSkin();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsIServiceManager* mServiceManager;
|
nsIServiceManager* mServiceManager;
|
||||||
|
@ -994,6 +997,33 @@ ScopedXPCOMStartup::SetWindowCreator(nsINativeAppSupport* native)
|
||||||
return wwatch->SetWindowCreator(creator);
|
return wwatch->SetWindowCreator(creator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_DEFINE_CID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
|
||||||
|
|
||||||
|
void
|
||||||
|
ScopedXPCOMStartup::CheckAccessibleSkin()
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsILookAndFeel> lookAndFeel (do_GetService(kLookAndFeelCID));
|
||||||
|
|
||||||
|
if (lookAndFeel) {
|
||||||
|
PRInt32 useAccessibilityTheme = 0;
|
||||||
|
|
||||||
|
lookAndFeel->GetMetric(nsILookAndFeel::eMetric_UseAccessibilityTheme,
|
||||||
|
useAccessibilityTheme);
|
||||||
|
|
||||||
|
if (useAccessibilityTheme) {
|
||||||
|
// If OS accessibility is active, use the classic skin, which obeys the
|
||||||
|
// system accessibility colors.
|
||||||
|
nsCOMPtr<nsIXULChromeRegistry> chromeRegistry
|
||||||
|
(do_GetService(NS_CHROMEREGISTRY_CONTRACTID));
|
||||||
|
if (chromeRegistry) {
|
||||||
|
// Make change this session only
|
||||||
|
chromeRegistry->SetRuntimeProvider(PR_TRUE);
|
||||||
|
chromeRegistry->SelectSkin(NS_LITERAL_CSTRING("classic/1.0"), PR_TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// don't modify aAppDir directly... clone it first
|
// don't modify aAppDir directly... clone it first
|
||||||
static int
|
static int
|
||||||
VerifyInstallation(nsIFile* aAppDir)
|
VerifyInstallation(nsIFile* aAppDir)
|
||||||
|
@ -1306,6 +1336,8 @@ ShowProfileManager(nsIToolkitProfileService* aProfileSvc,
|
||||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
|
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
{ //extra scoping is needed so we release these components before xpcom shutdown
|
{ //extra scoping is needed so we release these components before xpcom shutdown
|
||||||
|
xpcom.CheckAccessibleSkin();
|
||||||
|
|
||||||
nsCOMPtr<nsIWindowWatcher> windowWatcher
|
nsCOMPtr<nsIWindowWatcher> windowWatcher
|
||||||
(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
|
(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
|
||||||
nsCOMPtr<nsIDialogParamBlock> ioParamBlock
|
nsCOMPtr<nsIDialogParamBlock> ioParamBlock
|
||||||
|
@ -1871,6 +1903,8 @@ int xre_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||||
io->SetOffline(PR_TRUE);
|
io->SetOffline(PR_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xpcom.CheckAccessibleSkin();
|
||||||
|
|
||||||
{
|
{
|
||||||
NS_TIMELINE_ENTER("startupNotifier");
|
NS_TIMELINE_ENTER("startupNotifier");
|
||||||
nsCOMPtr<nsIObserver> startupNotifier
|
nsCOMPtr<nsIObserver> startupNotifier
|
||||||
|
|
Загрузка…
Ссылка в новой задаче