Bug 1296625 - Replace query to ui.use_activity_cursor pref with a cached bool value. r=smaug
MozReview-Commit-ID: GeTr29JG4qy
This commit is contained in:
@@ -7369,7 +7369,7 @@ nsDocShell::OnStateChange(nsIWebProgress* aProgress, nsIRequest* aRequest,
|
||||
|
||||
if ((aStateFlags & STATE_RESTORING) == 0) {
|
||||
// Show the progress cursor if the pref is set
|
||||
if (Preferences::GetBool("ui.use_activity_cursor", false)) {
|
||||
if (nsContentUtils::UseActivityCursor()) {
|
||||
nsCOMPtr<nsIWidget> mainWidget;
|
||||
GetMainWidget(getter_AddRefs(mainWidget));
|
||||
if (mainWidget) {
|
||||
@@ -7385,7 +7385,7 @@ nsDocShell::OnStateChange(nsIWebProgress* aProgress, nsIRequest* aRequest,
|
||||
mBusyFlags = BUSY_FLAGS_NONE;
|
||||
|
||||
// Hide the progress cursor if the pref is set
|
||||
if (Preferences::GetBool("ui.use_activity_cursor", false)) {
|
||||
if (nsContentUtils::UseActivityCursor()) {
|
||||
nsCOMPtr<nsIWidget> mainWidget;
|
||||
GetMainWidget(getter_AddRefs(mainWidget));
|
||||
if (mainWidget) {
|
||||
|
||||
@@ -282,6 +282,7 @@ bool nsContentUtils::sGettersDecodeURLHash = false;
|
||||
bool nsContentUtils::sPrivacyResistFingerprinting = false;
|
||||
bool nsContentUtils::sSendPerformanceTimingNotifications = false;
|
||||
bool nsContentUtils::sAppendLFInSerialization = false;
|
||||
bool nsContentUtils::sUseActivityCursor = false;
|
||||
|
||||
uint32_t nsContentUtils::sHandlingInputTimeout = 1000;
|
||||
|
||||
@@ -606,6 +607,9 @@ nsContentUtils::Init()
|
||||
Preferences::AddBoolVarCache(&sDoNotTrackEnabled,
|
||||
"privacy.donottrackheader.enabled", false);
|
||||
|
||||
Preferences::AddBoolVarCache(&sUseActivityCursor,
|
||||
"ui.use_activity_cursor", false);
|
||||
|
||||
Element::InitCCCallbacks();
|
||||
|
||||
nsCOMPtr<nsIUUIDGenerator> uuidGenerator =
|
||||
|
||||
@@ -2062,6 +2062,14 @@ public:
|
||||
return sPrivacyResistFingerprinting;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the browser should show busy cursor when loading page.
|
||||
*/
|
||||
static bool UseActivityCursor()
|
||||
{
|
||||
return sUseActivityCursor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this doc is controlled by a ServiceWorker.
|
||||
*/
|
||||
@@ -2781,6 +2789,7 @@ private:
|
||||
static bool sPrivacyResistFingerprinting;
|
||||
static bool sSendPerformanceTimingNotifications;
|
||||
static bool sAppendLFInSerialization;
|
||||
static bool sUseActivityCursor;
|
||||
static uint32_t sCookiesLifetimePolicy;
|
||||
static uint32_t sCookiesBehavior;
|
||||
|
||||
|
||||
@@ -3567,7 +3567,7 @@ EventStateManager::UpdateCursor(nsPresContext* aPresContext,
|
||||
hotspotY = framecursor.mHotspotY;
|
||||
}
|
||||
|
||||
if (Preferences::GetBool("ui.use_activity_cursor", false)) {
|
||||
if (nsContentUtils::UseActivityCursor()) {
|
||||
// Check whether or not to show the busy cursor
|
||||
nsCOMPtr<nsIDocShell> docShell(aPresContext->GetDocShell());
|
||||
if (!docShell) return;
|
||||
|
||||
Reference in New Issue
Block a user