Skip to content

Commit

Permalink
Backed out changeset 95865502de4b (bug 1704853) for causing bustage o…
Browse files Browse the repository at this point in the history
…n AppWindow.cpp. CLOSED TREE
  • Loading branch information
ncsoregi committed Apr 15, 2021
1 parent c632b8a commit 1d1158f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 52 deletions.
12 changes: 0 additions & 12 deletions mozglue/misc/PreXULSkeletonUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1960,11 +1960,6 @@ static Result<Ok, PreXULSkeletonUIError> 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)));
Expand Down Expand Up @@ -2129,13 +2124,6 @@ Result<Ok, PreXULSkeletonUIError> 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));
Expand Down
8 changes: 0 additions & 8 deletions mozglue/misc/PreXULSkeletonUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ struct DevPixelSpan {
int end;
};

enum class SkeletonUIDensity { Default, Touch, Compact };

struct SkeletonUISettings {
uint32_t screenX;
uint32_t screenY;
Expand All @@ -50,7 +48,6 @@ struct SkeletonUISettings {
bool menubarShown;
bool bookmarksToolbarShown;
bool rtlEnabled;
SkeletonUIDensity uiDensity;
};

enum class ThemeMode : uint32_t { Invalid, Default, Dark, Light };
Expand All @@ -59,8 +56,6 @@ enum class SkeletonUIFlag : uint8_t {
MenubarShown,
BookmarksToolbarShown,
RtlEnabled,
TouchDensity,
CompactDensity,
};

struct ThemeColors {
Expand Down Expand Up @@ -98,7 +93,6 @@ enum class PreXULSkeletonUIError : uint32_t {
FailedBlitting,
FailedFillingBottomRect,
CrashedOnce,
BadUIDensity,
Unknown,
};

Expand Down Expand Up @@ -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";
}
Expand Down
32 changes: 0 additions & 32 deletions xpfe/appshell/AppWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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<nsIWindowsUIUtils> 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

Expand Down

0 comments on commit 1d1158f

Please sign in to comment.