From 1d1158f8b525159a96a518c971a0ffe8ea1a875b Mon Sep 17 00:00:00 2001 From: Csoregi Natalia Date: Fri, 16 Apr 2021 01:47:57 +0300 Subject: [PATCH] Backed out changeset 95865502de4b (bug 1704853) for causing bustage on AppWindow.cpp. CLOSED TREE --- mozglue/misc/PreXULSkeletonUI.cpp | 12 ------------ mozglue/misc/PreXULSkeletonUI.h | 8 -------- xpfe/appshell/AppWindow.cpp | 32 ------------------------------- 3 files changed, 52 deletions(-) diff --git a/mozglue/misc/PreXULSkeletonUI.cpp b/mozglue/misc/PreXULSkeletonUI.cpp index a42b31ab46578..0ef86fb067bcf 100644 --- a/mozglue/misc/PreXULSkeletonUI.cpp +++ b/mozglue/misc/PreXULSkeletonUI.cpp @@ -1960,11 +1960,6 @@ static Result CreateAndStorePreXULSkeletonUIImpl( sFlagsRegSuffix))); flags.deserialize(flagsUint); - if (flags.contains(SkeletonUIFlag::TouchDensity) || - flags.contains(SkeletonUIFlag::CompactDensity)) { - return Err(PreXULSkeletonUIError::BadUIDensity); - } - uint32_t theme; MOZ_TRY_VAR(theme, ReadRegUint(regKey, GetRegValueName(binPath.get(), sThemeRegSuffix))); @@ -2129,13 +2124,6 @@ Result PersistPreXULSkeletonUIValues( if (settings.rtlEnabled) { flags += SkeletonUIFlag::RtlEnabled; } - if (settings.uiDensity == SkeletonUIDensity::Touch) { - flags += SkeletonUIFlag::TouchDensity; - } - if (settings.uiDensity == SkeletonUIDensity::Compact) { - flags += SkeletonUIFlag::CompactDensity; - } - uint32_t flagsUint = flags.serialize(); MOZ_TRY(WriteRegUint(regKey, GetRegValueName(binPath.get(), sFlagsRegSuffix), flagsUint)); diff --git a/mozglue/misc/PreXULSkeletonUI.h b/mozglue/misc/PreXULSkeletonUI.h index 1aad53cf17880..4d1a939310e9b 100644 --- a/mozglue/misc/PreXULSkeletonUI.h +++ b/mozglue/misc/PreXULSkeletonUI.h @@ -35,8 +35,6 @@ struct DevPixelSpan { int end; }; -enum class SkeletonUIDensity { Default, Touch, Compact }; - struct SkeletonUISettings { uint32_t screenX; uint32_t screenY; @@ -50,7 +48,6 @@ struct SkeletonUISettings { bool menubarShown; bool bookmarksToolbarShown; bool rtlEnabled; - SkeletonUIDensity uiDensity; }; enum class ThemeMode : uint32_t { Invalid, Default, Dark, Light }; @@ -59,8 +56,6 @@ enum class SkeletonUIFlag : uint8_t { MenubarShown, BookmarksToolbarShown, RtlEnabled, - TouchDensity, - CompactDensity, }; struct ThemeColors { @@ -98,7 +93,6 @@ enum class PreXULSkeletonUIError : uint32_t { FailedBlitting, FailedFillingBottomRect, CrashedOnce, - BadUIDensity, Unknown, }; @@ -149,8 +143,6 @@ inline const wchar_t* GetPreXULSkeletonUIErrorString( return L"FailedFillingBottomRect"; case PreXULSkeletonUIError::CrashedOnce: return L"CrashedOnce"; - case PreXULSkeletonUIError::BadUIDensity: - return L"BadUIDensity"; case PreXULSkeletonUIError::Unknown: return L"Unknown"; } diff --git a/xpfe/appshell/AppWindow.cpp b/xpfe/appshell/AppWindow.cpp index 4514eb6518036..8cd674095c052 100644 --- a/xpfe/appshell/AppWindow.cpp +++ b/xpfe/appshell/AppWindow.cpp @@ -38,7 +38,6 @@ #include "nsIScreenManager.h" #include "nsIScreen.h" #include "nsIWindowWatcher.h" -#include "nsIWindowsUIUtils.h" #include "nsIURI.h" #include "nsAppShellCID.h" #include "nsReadableUtils.h" @@ -1917,37 +1916,6 @@ nsresult AppWindow::MaybeSaveEarlyWindowPersistentValues( settings.rtlEnabled = intl::LocaleService::GetInstance()->IsAppLocaleRTL(); - bool isInTabletMode = false; - bool autoTouchModePref = - Preferences::GetBool("browser.touchmode.auto", false); - if (autoTouchModePref) { - nsCOMPtr uiUtils( - do_GetService("@mozilla.org/windows-ui-utils;1")); - if (!NS_WARN_IF(!uiUtils)) { - uiUtils->GetInTabletMode(&isInTabletMode); - } - } - - if (isInTabletMode) { - settings.uiDensity = SkeletonUIDensity::Touch; - } else { - int uiDensityPref = Preferences::GetInt("browser.uidensity", 0); - switch (uiDensityPref) { - case 0: { - settings.uiDensity = SkeletonUIDensity::Default; - break; - } - case 1: { - settings.uiDensity = SkeletonUIDensity::Compact; - break; - } - case 2: { - settings.uiDensity = SkeletonUIDensity::Touch; - break; - } - } - } - Unused << PersistPreXULSkeletonUIValues(settings); #endif