This commit is contained in:
Ryan VanderMeulen 2013-01-26 21:23:50 -05:00
Родитель 1bb6e32d4b 2a0981338e
Коммит a983d32d90
7 изменённых файлов: 35 добавлений и 2 удалений

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

@ -1973,6 +1973,7 @@ GK_ATOM(windows_default_theme, "windows-default-theme")
GK_ATOM(mac_graphite_theme, "mac-graphite-theme")
GK_ATOM(mac_lion_theme, "mac-lion-theme")
GK_ATOM(windows_compositor, "windows-compositor")
GK_ATOM(windows_glass, "windows-glass")
GK_ATOM(touch_enabled, "touch-enabled")
GK_ATOM(maemo_classic, "maemo-classic")
GK_ATOM(menubar_drag, "menubar-drag")
@ -2000,6 +2001,7 @@ GK_ATOM(_moz_mac_graphite_theme, "-moz-mac-graphite-theme")
GK_ATOM(_moz_mac_lion_theme, "-moz-mac-lion-theme")
GK_ATOM(_moz_windows_compositor, "-moz-windows-compositor")
GK_ATOM(_moz_windows_classic, "-moz-windows-classic")
GK_ATOM(_moz_windows_glass, "-moz-windows-glass")
GK_ATOM(_moz_windows_theme, "-moz-windows-theme")
GK_ATOM(_moz_touch_enabled, "-moz-touch-enabled")
GK_ATOM(_moz_maemo_classic, "-moz-maemo-classic")

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

@ -1161,6 +1161,11 @@ InitSystemMetrics()
sSystemMetrics->AppendElement(nsGkAtoms::windows_compositor);
}
rv = LookAndFeel::GetInt(LookAndFeel::eIntID_WindowsGlass, &metricResult);
if (NS_SUCCEEDED(rv) && metricResult) {
sSystemMetrics->AppendElement(nsGkAtoms::windows_glass);
}
rv = LookAndFeel::GetInt(LookAndFeel::eIntID_WindowsClassic, &metricResult);
if (NS_SUCCEEDED(rv) && metricResult) {
sSystemMetrics->AppendElement(nsGkAtoms::windows_classic);

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

@ -547,6 +547,13 @@ nsMediaFeatures::features[] = {
{ &nsGkAtoms::windows_classic },
GetSystemMetric
},
{
&nsGkAtoms::_moz_windows_glass,
nsMediaFeature::eMinMaxNotAllowed,
nsMediaFeature::eBoolInteger,
{ &nsGkAtoms::windows_glass },
GetSystemMetric
},
{
&nsGkAtoms::_moz_touch_enabled,
nsMediaFeature::eMinMaxNotAllowed,

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

@ -558,6 +558,7 @@ function run() {
expression_should_be_parseable("-moz-mac-lion-theme");
expression_should_be_parseable("-moz-windows-compositor");
expression_should_be_parseable("-moz-windows-classic");
expression_should_be_parseable("-moz-windows-glass");
expression_should_be_parseable("-moz-touch-enabled");
expression_should_be_parseable("-moz-maemo-classic");
@ -573,6 +574,7 @@ function run() {
expression_should_be_parseable("-moz-mac-lion-theme: 0");
expression_should_be_parseable("-moz-windows-compositor: 0");
expression_should_be_parseable("-moz-windows-classic: 0");
expression_should_be_parseable("-moz-windows-glass: 0");
expression_should_be_parseable("-moz-touch-enabled: 0");
expression_should_be_parseable("-moz-maemo-classic: 0");
@ -588,6 +590,7 @@ function run() {
expression_should_be_parseable("-moz-mac-lion-theme: 1");
expression_should_be_parseable("-moz-windows-compositor: 1");
expression_should_be_parseable("-moz-windows-classic: 1");
expression_should_be_parseable("-moz-windows-glass: 1");
expression_should_be_parseable("-moz-touch-enabled: 1");
expression_should_be_parseable("-moz-maemo-classic: 1");
@ -603,6 +606,7 @@ function run() {
expression_should_not_be_parseable("-moz-mac-lion-theme: -1");
expression_should_not_be_parseable("-moz-windows-compositor: -1");
expression_should_not_be_parseable("-moz-windows-classic: -1");
expression_should_not_be_parseable("-moz-windows-glass: -1");
expression_should_not_be_parseable("-moz-touch-enabled: -1");
expression_should_not_be_parseable("-moz-maemo-classic: -1");
@ -618,6 +622,7 @@ function run() {
expression_should_not_be_parseable("-moz-mac-lion-theme: true");
expression_should_not_be_parseable("-moz-windows-compositor: true");
expression_should_not_be_parseable("-moz-windows-classic: true");
expression_should_not_be_parseable("-moz-windows-glass: true");
expression_should_not_be_parseable("-moz-touch-enabled: true");
expression_should_not_be_parseable("-moz-maemo-classic: true");

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

@ -250,6 +250,15 @@ public:
*/
eIntID_WindowsClassic,
/*
* A Boolean value to determine whether the current Windows desktop theme
* supports Aero Glass.
*
* This is Windows-specific and is not implemented on other platforms
* (will return the default of NS_ERROR_FAILURE).
*/
eIntID_WindowsGlass,
/*
* A Boolean value to determine whether the device is a touch enabled
* device. Currently this is only supported by the Windows 7 Touch API.

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

@ -43,9 +43,9 @@ public:
WIN2K3_VERSION = 0x502,
VISTA_VERSION = 0x600,
// WIN2K8_VERSION = VISTA_VERSION,
WIN7_VERSION = 0x601
WIN7_VERSION = 0x601,
// WIN2K8R2_VERSION = WIN7_VERSION
// WIN8_VERSION = 0x602
WIN8_VERSION = 0x602
};
static WinVersion GetWindowsVersion();

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

@ -396,6 +396,11 @@ nsLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult)
case eIntID_DWMCompositor:
aResult = nsUXThemeData::CheckForCompositor();
break;
case eIntID_WindowsGlass:
// Aero Glass is only available prior to Windows 8 when DWM is used.
aResult = (nsUXThemeData::CheckForCompositor() &&
WinUtils::GetWindowsVersion() < WinUtils::WIN8_VERSION);
break;
case eIntID_AlertNotificationOrigin:
aResult = 0;
{