Bug 1258033 - Part 1: Add IsTrackingProtectionOn for nsILoadContext. r=smaug

MozReview-Commit-ID: 2eQzO6KDLyX
This commit is contained in:
dimi
2016-06-02 10:12:39 +08:00
parent bb5811c20d
commit f5dbedafaa
6 changed files with 57 additions and 0 deletions

View File

@@ -13375,6 +13375,21 @@ nsDocShell::IsAppOfType(uint32_t aAppType, bool* aIsOfType)
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::IsTrackingProtectionOn(bool* aIsTrackingProtectionOn)
{
if (Preferences::GetBool("privacy.trackingprotection.enabled", false)) {
*aIsTrackingProtectionOn = true;
} else if (mInPrivateBrowsing &&
Preferences::GetBool("privacy.trackingprotection.pbmode.enabled", false)) {
*aIsTrackingProtectionOn = true;
} else {
*aIsTrackingProtectionOn = false;
}
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::GetIsContent(bool* aIsContent)
{