move site settings patches after Content-settings-infrastructure.patch
This commit is contained in:
parent
733f3fe404
commit
2ed315ab74
5 changed files with 107 additions and 161 deletions
|
@ -116,6 +116,7 @@ Disable-the-DIAL-repeating-discovery.patch
|
|||
Block-qjz9zk-or-trk-requests.patch
|
||||
Hardening-against-incognito-mode-detection.patch
|
||||
Remove-weblayer-dependency-on-Play-Services.patch
|
||||
Content-settings-infrastructure.patch
|
||||
Timezone-customization.patch
|
||||
Move-some-account-settings-back-to-privacy-settings.patch
|
||||
Restore-Simplified-NTP-launch.patch
|
||||
|
|
|
@ -44,7 +44,7 @@ Subject: Revert the removal of an option to block autoplay
|
|||
diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/browser_ui/site_settings/android/BUILD.gn
|
||||
--- a/components/browser_ui/site_settings/android/BUILD.gn
|
||||
+++ b/components/browser_ui/site_settings/android/BUILD.gn
|
||||
@@ -148,6 +148,11 @@ android_resources("java_resources") {
|
||||
@@ -152,6 +152,11 @@ android_resources("java_resources") {
|
||||
"java/res/drawable-xxxhdpi/permission_protected_media.png",
|
||||
"java/res/drawable-xxxhdpi/settings_sensors.png",
|
||||
"java/res/drawable-xxxhdpi/web_asset.png",
|
||||
|
@ -196,7 +196,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
|
||||
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
|
||||
@@ -581,6 +581,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
@@ -589,6 +589,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
int resource = 0;
|
||||
if (mCategory.showSites(SiteSettingsCategory.Type.AUTOMATIC_DOWNLOADS)) {
|
||||
resource = R.string.website_settings_add_site_description_automatic_downloads;
|
||||
|
@ -205,7 +205,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
} else if (mCategory.showSites(SiteSettingsCategory.Type.BACKGROUND_SYNC)) {
|
||||
resource = R.string.website_settings_add_site_description_background_sync;
|
||||
} else if (mCategory.showSites(SiteSettingsCategory.Type.JAVASCRIPT)) {
|
||||
@@ -701,6 +703,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
@@ -711,6 +713,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
boolean allowSpecifyingExceptions = false;
|
||||
if (mCategory.showSites(SiteSettingsCategory.Type.SOUND)) {
|
||||
allowSpecifyingExceptions = true;
|
||||
|
@ -217,7 +217,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
|
||||
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
|
||||
@@ -124,6 +124,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
@@ -125,6 +125,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
return "bluetooth_scanning_permission_list";
|
||||
case ContentSettingsType.COOKIES:
|
||||
return "cookies_permission_list";
|
||||
|
@ -226,7 +226,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
case ContentSettingsType.IDLE_DETECTION:
|
||||
return "idle_detection_permission_list";
|
||||
case ContentSettingsType.JAVASCRIPT:
|
||||
@@ -490,6 +492,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
@@ -492,6 +494,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
|
||||
if (type == ContentSettingsType.ADS) {
|
||||
setUpAdsPreference(preference);
|
||||
|
@ -235,7 +235,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
} else if (type == ContentSettingsType.SOUND) {
|
||||
setUpSoundPreference(preference);
|
||||
} else if (type == ContentSettingsType.JAVASCRIPT) {
|
||||
@@ -980,6 +984,24 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
@@ -987,6 +991,24 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
setupContentSettingsPreference(preference, currentValue, false /* isEmbargoed */);
|
||||
}
|
||||
|
||||
|
@ -285,7 +285,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
}
|
||||
|
||||
private final BrowserContextHandle mBrowserContextHandle;
|
||||
@@ -188,6 +189,8 @@ public class SiteSettingsCategory {
|
||||
@@ -191,6 +192,8 @@ public class SiteSettingsCategory {
|
||||
return ContentSettingsType.NFC;
|
||||
case Type.NOTIFICATIONS:
|
||||
return ContentSettingsType.NOTIFICATIONS;
|
||||
|
@ -294,7 +294,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
case Type.POPUPS:
|
||||
return ContentSettingsType.POPUPS;
|
||||
case Type.PROTECTED_MEDIA:
|
||||
@@ -266,6 +269,8 @@ public class SiteSettingsCategory {
|
||||
@@ -269,6 +272,8 @@ public class SiteSettingsCategory {
|
||||
return "nfc";
|
||||
case Type.NOTIFICATIONS:
|
||||
return "notifications";
|
||||
|
@ -365,7 +365,7 @@ diff --git a/components/browser_ui/strings/android/site_settings.grdp b/componen
|
|||
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
--- a/components/content_settings/core/browser/content_settings_registry.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
@@ -318,7 +318,7 @@ void ContentSettingsRegistry::Init() {
|
||||
@@ -320,7 +320,7 @@ void ContentSettingsRegistry::Init() {
|
||||
ContentSettingsInfo::PERSISTENT,
|
||||
ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY);
|
||||
|
||||
|
@ -480,7 +480,7 @@ diff --git a/components/content_settings/renderer/content_settings_agent_impl.h
|
|||
diff --git a/components/page_info/android/page_info_controller_android.cc b/components/page_info/android/page_info_controller_android.cc
|
||||
--- a/components/page_info/android/page_info_controller_android.cc
|
||||
+++ b/components/page_info/android/page_info_controller_android.cc
|
||||
@@ -141,6 +141,7 @@ void PageInfoControllerAndroid::SetPermissionInfo(
|
||||
@@ -142,6 +142,7 @@ void PageInfoControllerAndroid::SetPermissionInfo(
|
||||
permissions_to_display.push_back(ContentSettingsType::ADS);
|
||||
permissions_to_display.push_back(
|
||||
ContentSettingsType::PROTECTED_MEDIA_IDENTIFIER);
|
||||
|
@ -491,7 +491,7 @@ diff --git a/components/page_info/android/page_info_controller_android.cc b/comp
|
|||
diff --git a/components/page_info/page_info.cc b/components/page_info/page_info.cc
|
||||
--- a/components/page_info/page_info.cc
|
||||
+++ b/components/page_info/page_info.cc
|
||||
@@ -98,6 +98,7 @@ ContentSettingsType kPermissionType[] = {
|
||||
@@ -99,6 +99,7 @@ ContentSettingsType kPermissionType[] = {
|
||||
ContentSettingsType::ADS,
|
||||
ContentSettingsType::BACKGROUND_SYNC,
|
||||
ContentSettingsType::SOUND,
|
||||
|
@ -499,7 +499,7 @@ diff --git a/components/page_info/page_info.cc b/components/page_info/page_info.
|
|||
ContentSettingsType::AUTOMATIC_DOWNLOADS,
|
||||
#if defined(OS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_WIN)
|
||||
ContentSettingsType::PROTECTED_MEDIA_IDENTIFIER,
|
||||
@@ -140,6 +141,11 @@ bool ShouldShowPermission(const PageInfo::PermissionInfo& info,
|
||||
@@ -141,6 +142,11 @@ bool ShouldShowPermission(const PageInfo::PermissionInfo& info,
|
||||
return is_subresource_filter_activated;
|
||||
}
|
||||
|
||||
|
@ -514,7 +514,7 @@ diff --git a/components/page_info/page_info.cc b/components/page_info/page_info.
|
|||
diff --git a/components/page_info/page_info_ui.cc b/components/page_info/page_info_ui.cc
|
||||
--- a/components/page_info/page_info_ui.cc
|
||||
+++ b/components/page_info/page_info_ui.cc
|
||||
@@ -161,6 +161,7 @@ base::span<const PageInfoUI::PermissionUIInfo> GetContentSettingsUIInfo() {
|
||||
@@ -162,6 +162,7 @@ base::span<const PageInfoUI::PermissionUIInfo> GetContentSettingsUIInfo() {
|
||||
#endif
|
||||
{ContentSettingsType::ADS, IDS_SITE_SETTINGS_TYPE_ADS,
|
||||
IDS_SITE_SETTINGS_TYPE_ADS_MID_SENTENCE},
|
||||
|
|
|
@ -35,7 +35,7 @@ Subject: Site setting for images
|
|||
diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/browser_ui/site_settings/android/BUILD.gn
|
||||
--- a/components/browser_ui/site_settings/android/BUILD.gn
|
||||
+++ b/components/browser_ui/site_settings/android/BUILD.gn
|
||||
@@ -115,6 +115,7 @@ android_resources("java_resources") {
|
||||
@@ -119,6 +119,7 @@ android_resources("java_resources") {
|
||||
sources = [
|
||||
"java/res/drawable-hdpi/ic_volume_up_grey600_24dp.png",
|
||||
"java/res/drawable-hdpi/permission_background_sync.png",
|
||||
|
@ -43,7 +43,7 @@ diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/b
|
|||
"java/res/drawable-hdpi/permission_javascript.png",
|
||||
"java/res/drawable-hdpi/permission_popups.png",
|
||||
"java/res/drawable-hdpi/permission_protected_media.png",
|
||||
@@ -122,6 +123,7 @@ android_resources("java_resources") {
|
||||
@@ -126,6 +127,7 @@ android_resources("java_resources") {
|
||||
"java/res/drawable-hdpi/web_asset.png",
|
||||
"java/res/drawable-mdpi/ic_volume_up_grey600_24dp.png",
|
||||
"java/res/drawable-mdpi/permission_background_sync.png",
|
||||
|
@ -51,7 +51,7 @@ diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/b
|
|||
"java/res/drawable-mdpi/permission_javascript.png",
|
||||
"java/res/drawable-mdpi/permission_popups.png",
|
||||
"java/res/drawable-mdpi/permission_protected_media.png",
|
||||
@@ -129,6 +131,7 @@ android_resources("java_resources") {
|
||||
@@ -133,6 +135,7 @@ android_resources("java_resources") {
|
||||
"java/res/drawable-mdpi/web_asset.png",
|
||||
"java/res/drawable-xhdpi/ic_volume_up_grey600_24dp.png",
|
||||
"java/res/drawable-xhdpi/permission_background_sync.png",
|
||||
|
@ -59,7 +59,7 @@ diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/b
|
|||
"java/res/drawable-xhdpi/permission_javascript.png",
|
||||
"java/res/drawable-xhdpi/permission_popups.png",
|
||||
"java/res/drawable-xhdpi/permission_protected_media.png",
|
||||
@@ -136,6 +139,7 @@ android_resources("java_resources") {
|
||||
@@ -140,6 +143,7 @@ android_resources("java_resources") {
|
||||
"java/res/drawable-xhdpi/web_asset.png",
|
||||
"java/res/drawable-xxhdpi/ic_volume_up_grey600_24dp.png",
|
||||
"java/res/drawable-xxhdpi/permission_background_sync.png",
|
||||
|
@ -67,7 +67,7 @@ diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/b
|
|||
"java/res/drawable-xxhdpi/permission_javascript.png",
|
||||
"java/res/drawable-xxhdpi/permission_popups.png",
|
||||
"java/res/drawable-xxhdpi/permission_protected_media.png",
|
||||
@@ -143,6 +147,7 @@ android_resources("java_resources") {
|
||||
@@ -147,6 +151,7 @@ android_resources("java_resources") {
|
||||
"java/res/drawable-xxhdpi/web_asset.png",
|
||||
"java/res/drawable-xxxhdpi/ic_volume_up_grey600_24dp.png",
|
||||
"java/res/drawable-xxxhdpi/permission_background_sync.png",
|
||||
|
@ -188,7 +188,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
|
||||
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
|
||||
@@ -595,6 +595,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
@@ -603,6 +603,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
browserContextHandle, ContentSettingsType.SOUND)
|
||||
? R.string.website_settings_add_site_description_sound_block
|
||||
: R.string.website_settings_add_site_description_sound_allow;
|
||||
|
@ -197,7 +197,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
} else if (mCategory.showSites(SiteSettingsCategory.Type.COOKIES)) {
|
||||
if (mRequiresFourStateSetting) {
|
||||
resource = cookieSettingsExceptionShouldBlock()
|
||||
@@ -707,6 +709,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
@@ -717,6 +719,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
allowSpecifyingExceptions = true;
|
||||
} else if (mCategory.showSites(SiteSettingsCategory.Type.JAVASCRIPT)) {
|
||||
allowSpecifyingExceptions = true;
|
||||
|
@ -209,7 +209,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
|
||||
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
|
||||
@@ -128,6 +128,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
@@ -129,6 +129,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
return "autoplay_permission_list";
|
||||
case ContentSettingsType.IDLE_DETECTION:
|
||||
return "idle_detection_permission_list";
|
||||
|
@ -218,7 +218,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
case ContentSettingsType.JAVASCRIPT:
|
||||
return "javascript_permission_list";
|
||||
case ContentSettingsType.POPUPS:
|
||||
@@ -500,6 +502,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
@@ -502,6 +504,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
setUpJavascriptPreference(preference);
|
||||
} else if (type == ContentSettingsType.COOKIES) {
|
||||
setUpCookiesPreference(preference);
|
||||
|
@ -227,7 +227,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
} else if (type == ContentSettingsType.GEOLOCATION) {
|
||||
setUpLocationPreference(preference);
|
||||
} else if (type == ContentSettingsType.NOTIFICATIONS) {
|
||||
@@ -1069,6 +1073,24 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
@@ -1076,6 +1080,24 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
setupContentSettingsPreference(preference, permission, false /* isEmbargoed */);
|
||||
}
|
||||
|
||||
|
@ -277,7 +277,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
}
|
||||
|
||||
private final BrowserContextHandle mBrowserContextHandle;
|
||||
@@ -181,6 +182,8 @@ public class SiteSettingsCategory {
|
||||
@@ -184,6 +185,8 @@ public class SiteSettingsCategory {
|
||||
return ContentSettingsType.GEOLOCATION;
|
||||
case Type.IDLE_DETECTION:
|
||||
return ContentSettingsType.IDLE_DETECTION;
|
||||
|
@ -286,7 +286,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
case Type.JAVASCRIPT:
|
||||
return ContentSettingsType.JAVASCRIPT;
|
||||
case Type.MICROPHONE:
|
||||
@@ -263,6 +266,8 @@ public class SiteSettingsCategory {
|
||||
@@ -266,6 +269,8 @@ public class SiteSettingsCategory {
|
||||
return "idle_detection";
|
||||
case Type.JAVASCRIPT:
|
||||
return "javascript";
|
||||
|
@ -370,7 +370,7 @@ diff --git a/components/browser_ui/strings/android/site_settings.grdp b/componen
|
|||
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
--- a/components/content_settings/core/browser/content_settings_registry.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
@@ -148,7 +148,8 @@ void ContentSettingsRegistry::Init() {
|
||||
@@ -150,7 +150,8 @@ void ContentSettingsRegistry::Init() {
|
||||
kExtensionScheme),
|
||||
ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK),
|
||||
WebsiteSettingsInfo::SINGLE_ORIGIN_WITH_EMBEDDED_EXCEPTIONS_SCOPE,
|
||||
|
@ -402,7 +402,7 @@ diff --git a/components/content_settings/core/browser/content_settings_utils.cc
|
|||
diff --git a/components/page_info/android/page_info_controller_android.cc b/components/page_info/android/page_info_controller_android.cc
|
||||
--- a/components/page_info/android/page_info_controller_android.cc
|
||||
+++ b/components/page_info/android/page_info_controller_android.cc
|
||||
@@ -221,6 +221,10 @@ absl::optional<ContentSetting> PageInfoControllerAndroid::GetSettingToDisplay(
|
||||
@@ -230,6 +230,10 @@ absl::optional<ContentSetting> PageInfoControllerAndroid::GetSettingToDisplay(
|
||||
// audio since last navigation.
|
||||
if (web_contents_->WasEverAudible())
|
||||
return permission.default_setting;
|
||||
|
@ -410,13 +410,13 @@ diff --git a/components/page_info/android/page_info_controller_android.cc b/comp
|
|||
+ // The images content setting should show up if it is blocked globally
|
||||
+ // to give users an easy way to create exceptions.
|
||||
+ return permission.default_setting;
|
||||
}
|
||||
|
||||
// TODO(crbug.com/1077766): Also return permissions that are non
|
||||
} else {
|
||||
content_settings::WebsiteSettingsRegistry* website_settings =
|
||||
content_settings::WebsiteSettingsRegistry::GetInstance();
|
||||
diff --git a/components/page_info/page_info.cc b/components/page_info/page_info.cc
|
||||
--- a/components/page_info/page_info.cc
|
||||
+++ b/components/page_info/page_info.cc
|
||||
@@ -90,9 +90,7 @@ ContentSettingsType kPermissionType[] = {
|
||||
@@ -91,9 +91,7 @@ ContentSettingsType kPermissionType[] = {
|
||||
ContentSettingsType::SENSORS,
|
||||
ContentSettingsType::NOTIFICATIONS,
|
||||
ContentSettingsType::JAVASCRIPT,
|
||||
|
@ -426,7 +426,7 @@ diff --git a/components/page_info/page_info.cc b/components/page_info/page_info.
|
|||
ContentSettingsType::POPUPS,
|
||||
ContentSettingsType::WINDOW_PLACEMENT,
|
||||
ContentSettingsType::ADS,
|
||||
@@ -146,6 +144,11 @@ bool ShouldShowPermission(const PageInfo::PermissionInfo& info,
|
||||
@@ -147,6 +145,11 @@ bool ShouldShowPermission(const PageInfo::PermissionInfo& info,
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -441,7 +441,7 @@ diff --git a/components/page_info/page_info.cc b/components/page_info/page_info.
|
|||
diff --git a/components/page_info/page_info_ui.cc b/components/page_info/page_info_ui.cc
|
||||
--- a/components/page_info/page_info_ui.cc
|
||||
+++ b/components/page_info/page_info_ui.cc
|
||||
@@ -195,6 +195,8 @@ base::span<const PageInfoUI::PermissionUIInfo> GetContentSettingsUIInfo() {
|
||||
@@ -196,6 +196,8 @@ base::span<const PageInfoUI::PermissionUIInfo> GetContentSettingsUIInfo() {
|
||||
IDS_SITE_SETTINGS_TYPE_CAMERA_PAN_TILT_ZOOM_MID_SENTENCE},
|
||||
{ContentSettingsType::IDLE_DETECTION, IDS_SITE_SETTINGS_TYPE_IDLE_DETECTION,
|
||||
IDS_SITE_SETTINGS_TYPE_IDLE_DETECTION_MID_SENTENCE},
|
||||
|
@ -450,7 +450,7 @@ diff --git a/components/page_info/page_info_ui.cc b/components/page_info/page_in
|
|||
#if !defined(OS_ANDROID)
|
||||
// Page Info Permissions that are not defined in Android.
|
||||
{ContentSettingsType::FILE_SYSTEM_WRITE_GUARD,
|
||||
@@ -204,8 +206,6 @@ base::span<const PageInfoUI::PermissionUIInfo> GetContentSettingsUIInfo() {
|
||||
@@ -205,8 +207,6 @@ base::span<const PageInfoUI::PermissionUIInfo> GetContentSettingsUIInfo() {
|
||||
IDS_SITE_SETTINGS_TYPE_FONT_ACCESS_MID_SENTENCE},
|
||||
{ContentSettingsType::HID_GUARD, IDS_SITE_SETTINGS_TYPE_HID_DEVICES,
|
||||
IDS_SITE_SETTINGS_TYPE_HID_DEVICES_MID_SENTENCE},
|
||||
|
|
|
@ -34,7 +34,7 @@ note: needs SitePerProcess and StrictOriginIsolation flags enabled
|
|||
diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/browser_ui/site_settings/android/BUILD.gn
|
||||
--- a/components/browser_ui/site_settings/android/BUILD.gn
|
||||
+++ b/components/browser_ui/site_settings/android/BUILD.gn
|
||||
@@ -117,6 +117,7 @@ android_resources("java_resources") {
|
||||
@@ -121,6 +121,7 @@ android_resources("java_resources") {
|
||||
"java/res/drawable-hdpi/permission_background_sync.png",
|
||||
"java/res/drawable-hdpi/permission_images.png",
|
||||
"java/res/drawable-hdpi/permission_javascript.png",
|
||||
|
@ -42,7 +42,7 @@ diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/b
|
|||
"java/res/drawable-hdpi/permission_popups.png",
|
||||
"java/res/drawable-hdpi/permission_protected_media.png",
|
||||
"java/res/drawable-hdpi/settings_sensors.png",
|
||||
@@ -125,6 +126,7 @@ android_resources("java_resources") {
|
||||
@@ -129,6 +130,7 @@ android_resources("java_resources") {
|
||||
"java/res/drawable-mdpi/permission_background_sync.png",
|
||||
"java/res/drawable-mdpi/permission_images.png",
|
||||
"java/res/drawable-mdpi/permission_javascript.png",
|
||||
|
@ -50,7 +50,7 @@ diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/b
|
|||
"java/res/drawable-mdpi/permission_popups.png",
|
||||
"java/res/drawable-mdpi/permission_protected_media.png",
|
||||
"java/res/drawable-mdpi/settings_sensors.png",
|
||||
@@ -133,6 +135,7 @@ android_resources("java_resources") {
|
||||
@@ -137,6 +139,7 @@ android_resources("java_resources") {
|
||||
"java/res/drawable-xhdpi/permission_background_sync.png",
|
||||
"java/res/drawable-xhdpi/permission_images.png",
|
||||
"java/res/drawable-xhdpi/permission_javascript.png",
|
||||
|
@ -58,7 +58,7 @@ diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/b
|
|||
"java/res/drawable-xhdpi/permission_popups.png",
|
||||
"java/res/drawable-xhdpi/permission_protected_media.png",
|
||||
"java/res/drawable-xhdpi/settings_sensors.png",
|
||||
@@ -141,6 +144,7 @@ android_resources("java_resources") {
|
||||
@@ -145,6 +148,7 @@ android_resources("java_resources") {
|
||||
"java/res/drawable-xxhdpi/permission_background_sync.png",
|
||||
"java/res/drawable-xxhdpi/permission_images.png",
|
||||
"java/res/drawable-xxhdpi/permission_javascript.png",
|
||||
|
@ -66,7 +66,7 @@ diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/b
|
|||
"java/res/drawable-xxhdpi/permission_popups.png",
|
||||
"java/res/drawable-xxhdpi/permission_protected_media.png",
|
||||
"java/res/drawable-xxhdpi/settings_sensors.png",
|
||||
@@ -149,6 +153,7 @@ android_resources("java_resources") {
|
||||
@@ -153,6 +157,7 @@ android_resources("java_resources") {
|
||||
"java/res/drawable-xxxhdpi/permission_background_sync.png",
|
||||
"java/res/drawable-xxxhdpi/permission_images.png",
|
||||
"java/res/drawable-xxxhdpi/permission_javascript.png",
|
||||
|
@ -206,7 +206,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
|
||||
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
|
||||
@@ -590,6 +590,11 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
@@ -598,6 +598,11 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
browserContextHandle, ContentSettingsType.JAVASCRIPT)
|
||||
? R.string.website_settings_add_site_description_javascript_block
|
||||
: R.string.website_settings_add_site_description_javascript_allow;
|
||||
|
@ -218,7 +218,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
} else if (mCategory.showSites(SiteSettingsCategory.Type.SOUND)) {
|
||||
resource = WebsitePreferenceBridge.isCategoryEnabled(
|
||||
browserContextHandle, ContentSettingsType.SOUND)
|
||||
@@ -711,6 +716,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
@@ -721,6 +726,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
allowSpecifyingExceptions = true;
|
||||
} else if (mCategory.showSites(SiteSettingsCategory.Type.IMAGES)) {
|
||||
allowSpecifyingExceptions = true;
|
||||
|
@ -230,7 +230,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
|
||||
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
|
||||
@@ -132,6 +132,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
@@ -133,6 +133,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
return "images_permission_list";
|
||||
case ContentSettingsType.JAVASCRIPT:
|
||||
return "javascript_permission_list";
|
||||
|
@ -239,7 +239,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
case ContentSettingsType.POPUPS:
|
||||
return "popup_permission_list";
|
||||
case ContentSettingsType.SOUND:
|
||||
@@ -504,6 +506,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
@@ -506,6 +508,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
setUpCookiesPreference(preference);
|
||||
} else if (type == ContentSettingsType.IMAGES) {
|
||||
setUpImagesPreference(preference);
|
||||
|
@ -248,7 +248,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
} else if (type == ContentSettingsType.GEOLOCATION) {
|
||||
setUpLocationPreference(preference);
|
||||
} else if (type == ContentSettingsType.NOTIFICATIONS) {
|
||||
@@ -1042,6 +1046,23 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
@@ -1049,6 +1053,23 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
setupContentSettingsPreference(preference, currentValue, false /* isEmbargoed */);
|
||||
}
|
||||
|
||||
|
@ -297,7 +297,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
}
|
||||
|
||||
private final BrowserContextHandle mBrowserContextHandle;
|
||||
@@ -186,6 +187,8 @@ public class SiteSettingsCategory {
|
||||
@@ -189,6 +190,8 @@ public class SiteSettingsCategory {
|
||||
return ContentSettingsType.IMAGES;
|
||||
case Type.JAVASCRIPT:
|
||||
return ContentSettingsType.JAVASCRIPT;
|
||||
|
@ -306,7 +306,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
case Type.MICROPHONE:
|
||||
return ContentSettingsType.MEDIASTREAM_MIC;
|
||||
case Type.NFC:
|
||||
@@ -268,6 +271,8 @@ public class SiteSettingsCategory {
|
||||
@@ -271,6 +274,8 @@ public class SiteSettingsCategory {
|
||||
return "javascript";
|
||||
case Type.IMAGES:
|
||||
return "images";
|
||||
|
@ -390,7 +390,7 @@ diff --git a/components/browser_ui/strings/android/site_settings.grdp b/componen
|
|||
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
--- a/components/content_settings/core/browser/content_settings_registry.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
@@ -602,7 +602,7 @@ void ContentSettingsRegistry::Init() {
|
||||
@@ -604,7 +604,7 @@ void ContentSettingsRegistry::Init() {
|
||||
ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY);
|
||||
|
||||
Register(ContentSettingsType::JAVASCRIPT_JIT, "javascript-jit",
|
||||
|
@ -402,7 +402,7 @@ diff --git a/components/content_settings/core/browser/content_settings_registry.
|
|||
diff --git a/components/page_info/android/page_info_controller_android.cc b/components/page_info/android/page_info_controller_android.cc
|
||||
--- a/components/page_info/android/page_info_controller_android.cc
|
||||
+++ b/components/page_info/android/page_info_controller_android.cc
|
||||
@@ -137,6 +137,7 @@ void PageInfoControllerAndroid::SetPermissionInfo(
|
||||
@@ -138,6 +138,7 @@ void PageInfoControllerAndroid::SetPermissionInfo(
|
||||
permissions_to_display.push_back(ContentSettingsType::IDLE_DETECTION);
|
||||
permissions_to_display.push_back(ContentSettingsType::IMAGES);
|
||||
permissions_to_display.push_back(ContentSettingsType::JAVASCRIPT);
|
||||
|
@ -410,7 +410,7 @@ diff --git a/components/page_info/android/page_info_controller_android.cc b/comp
|
|||
permissions_to_display.push_back(ContentSettingsType::POPUPS);
|
||||
permissions_to_display.push_back(ContentSettingsType::ADS);
|
||||
permissions_to_display.push_back(
|
||||
@@ -216,6 +217,8 @@ absl::optional<ContentSetting> PageInfoControllerAndroid::GetSettingToDisplay(
|
||||
@@ -225,6 +226,8 @@ absl::optional<ContentSetting> PageInfoControllerAndroid::GetSettingToDisplay(
|
||||
// The javascript content setting should show up if it is blocked globally
|
||||
// to give users an easy way to create exceptions.
|
||||
return permission.default_setting;
|
||||
|
@ -422,7 +422,7 @@ diff --git a/components/page_info/android/page_info_controller_android.cc b/comp
|
|||
diff --git a/components/page_info/page_info.cc b/components/page_info/page_info.cc
|
||||
--- a/components/page_info/page_info.cc
|
||||
+++ b/components/page_info/page_info.cc
|
||||
@@ -118,6 +118,7 @@ ContentSettingsType kPermissionType[] = {
|
||||
@@ -119,6 +119,7 @@ ContentSettingsType kPermissionType[] = {
|
||||
ContentSettingsType::VR,
|
||||
ContentSettingsType::AR,
|
||||
ContentSettingsType::IDLE_DETECTION,
|
||||
|
@ -430,7 +430,7 @@ diff --git a/components/page_info/page_info.cc b/components/page_info/page_info.
|
|||
};
|
||||
|
||||
// Determines whether to show permission |type| in the Page Info UI. Only
|
||||
@@ -156,6 +157,11 @@ bool ShouldShowPermission(const PageInfo::PermissionInfo& info,
|
||||
@@ -157,6 +158,11 @@ bool ShouldShowPermission(const PageInfo::PermissionInfo& info,
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -439,13 +439,13 @@ diff --git a/components/page_info/page_info.cc b/components/page_info/page_info.
|
|||
+ return true;
|
||||
+ }
|
||||
+
|
||||
const bool is_incognito = web_contents->GetBrowserContext()->IsOffTheRecord();
|
||||
#if defined(OS_ANDROID)
|
||||
// Special geolocation DSE settings apply only on Android, so make sure it
|
||||
content_settings::WebsiteSettingsRegistry* website_settings =
|
||||
content_settings::WebsiteSettingsRegistry::GetInstance();
|
||||
for (const content_settings::WebsiteSettingsInfo* winfo : *website_settings) {
|
||||
diff --git a/components/page_info/page_info_ui.cc b/components/page_info/page_info_ui.cc
|
||||
--- a/components/page_info/page_info_ui.cc
|
||||
+++ b/components/page_info/page_info_ui.cc
|
||||
@@ -136,6 +136,8 @@ base::span<const PageInfoUI::PermissionUIInfo> GetContentSettingsUIInfo() {
|
||||
@@ -137,6 +137,8 @@ base::span<const PageInfoUI::PermissionUIInfo> GetContentSettingsUIInfo() {
|
||||
IDS_SITE_SETTINGS_TYPE_COOKIES_MID_SENTENCE},
|
||||
{ContentSettingsType::JAVASCRIPT, IDS_SITE_SETTINGS_TYPE_JAVASCRIPT,
|
||||
IDS_SITE_SETTINGS_TYPE_JAVASCRIPT_MID_SENTENCE},
|
||||
|
|
|
@ -12,10 +12,9 @@ See also: https://github.com/bromite/bromite/wiki/TimezoneOverride
|
|||
...ezoneoverride_site_settings_preference.xml | 68 ++++++
|
||||
.../res/xml/site_settings_preferences.xml | 4 +
|
||||
.../java/res/xml/website_preferences.xml | 9 +
|
||||
.../ContentSettingsResources.java | 35 +++-
|
||||
.../site_settings/SingleCategorySettings.java | 77 ++++++-
|
||||
.../site_settings/SingleWebsiteSettings.java | 8 +-
|
||||
.../site_settings/SiteSettings.java | 2 +-
|
||||
.../ContentSettingsResources.java | 21 +-
|
||||
.../site_settings/SingleCategorySettings.java | 73 ++++++-
|
||||
.../site_settings/SingleWebsiteSettings.java | 2 +
|
||||
.../site_settings/SiteSettingsCategory.java | 10 +-
|
||||
.../site_settings/SiteSettingsDelegate.java | 2 +
|
||||
...imezoneOverrideSiteSettingsPreference.java | 193 ++++++++++++++++++
|
||||
|
@ -41,7 +40,7 @@ See also: https://github.com/bromite/bromite/wiki/TimezoneOverride
|
|||
.../renderer/content_settings_agent_impl.cc | 89 ++++++++
|
||||
.../renderer/content_settings_agent_impl.h | 4 +
|
||||
.../WebLayerSiteSettingsDelegate.java | 3 +
|
||||
35 files changed, 699 insertions(+), 15 deletions(-)
|
||||
34 files changed, 676 insertions(+), 12 deletions(-)
|
||||
create mode 100755 components/browser_ui/site_settings/android/java/res/layout/time_zone_select_dialog.xml
|
||||
create mode 100755 components/browser_ui/site_settings/android/java/res/layout/timezoneoverride_site_settings_preference.xml
|
||||
create mode 100755 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/TimezoneOverrideSiteSettingsPreference.java
|
||||
|
@ -86,9 +85,9 @@ diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/b
|
|||
"java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java",
|
||||
+ "java/src/org/chromium/components/browser_ui/site_settings/TimezoneOverrideSiteSettingsPreference.java"
|
||||
]
|
||||
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
|
||||
resources_package = "org.chromium.components.browser_ui.site_settings"
|
||||
@@ -162,6 +163,8 @@ android_resources("java_resources") {
|
||||
sources += [
|
||||
"java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java",
|
||||
@@ -166,6 +167,8 @@ android_resources("java_resources") {
|
||||
"java/res/xml/single_website_preferences.xml",
|
||||
"java/res/xml/site_settings_preferences.xml",
|
||||
"java/res/xml/website_preferences.xml",
|
||||
|
@ -266,33 +265,19 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
+ R.string.website_settings_category_timezone_override_custom,
|
||||
+ R.string.website_settings_category_timezone_override_random);
|
||||
}
|
||||
assert false; // NOTREACHED
|
||||
return null;
|
||||
@@ -441,6 +447,23 @@ public class ContentSettingsResources {
|
||||
ResourceItem ri = BromiteCustomContentSettingImpl.getResourceItem(contentType);
|
||||
if (ri != null) return ri;
|
||||
@@ -458,7 +464,8 @@ public class ContentSettingsResources {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+ public static int getCategorySummary(int contentType, @Nullable @ContentSettingValues int value) {
|
||||
+ if (contentType == ContentSettingsType.TIMEZONE_OVERRIDE) {
|
||||
+ switch (value) {
|
||||
+ case ContentSettingValues.ALLOW:
|
||||
+ return R.string.website_settings_category_timezone_override_allowed;
|
||||
+ case ContentSettingValues.ASK:
|
||||
+ return R.string.website_settings_category_timezone_override_custom;
|
||||
+ case ContentSettingValues.BLOCK:
|
||||
+ return R.string.website_settings_category_timezone_override_random;
|
||||
+ default:
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
- return getCategorySummary(value);
|
||||
+ else
|
||||
+ return getCategorySummary(value);
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string resource id for a content type to show with a permission category.
|
||||
* @param enabled Whether the content type is enabled.
|
||||
@@ -455,7 +478,10 @@ public class ContentSettingsResources {
|
||||
@@ -475,7 +482,10 @@ public class ContentSettingsResources {
|
||||
* with a particular website.
|
||||
* @param value The ContentSetting for which we want the resource.
|
||||
*/
|
||||
|
@ -304,7 +289,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
switch (value) {
|
||||
case ContentSettingValues.ALLOW:
|
||||
return R.string.website_settings_permissions_allow;
|
||||
@@ -561,6 +587,13 @@ public class ContentSettingsResources {
|
||||
@@ -583,6 +593,13 @@ public class ContentSettingsResources {
|
||||
return descriptionIDs;
|
||||
}
|
||||
}
|
||||
|
@ -358,9 +343,9 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
+ else
|
||||
+ return ContentSettingValues.BLOCK == contentSetting;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -387,7 +396,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
if (BromiteCustomContentSettingImpl.processOnBlockList(contentSetting, contentSetting))
|
||||
return BromiteCustomContentSettingImpl.isOnBlockList(contentSetting, website, contentSetting);
|
||||
@@ -390,7 +399,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
if (queryHasChanged) getInfoForOrigins();
|
||||
});
|
||||
|
||||
|
@ -370,7 +355,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
MenuItem help = menu.add(
|
||||
Menu.NONE, R.id.menu_id_site_settings_help, Menu.NONE, R.string.menu_help);
|
||||
help.setIcon(VectorDrawableCompat.create(
|
||||
@@ -398,7 +408,10 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
@@ -401,7 +411,10 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.menu_id_site_settings_help) {
|
||||
|
@ -382,7 +367,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
getSiteSettingsDelegate().launchProtectedContentHelpAndFeedbackActivity(
|
||||
getActivity());
|
||||
} else {
|
||||
@@ -492,6 +505,12 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
@@ -500,6 +513,12 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
WebsitePreferenceBridge.setDefaultContentSetting(
|
||||
browserContextHandle, mCategory.getContentSettingsType(), setting);
|
||||
getInfoForOrigins();
|
||||
|
@ -395,16 +380,16 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
} else if (FOUR_STATE_COOKIE_TOGGLE_KEY.equals(preference.getKey())) {
|
||||
setCookieSettingsPreference((CookieSettingsState) newValue);
|
||||
getInfoForOrigins();
|
||||
@@ -589,6 +608,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
@@ -597,6 +616,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
assert WebsitePreferenceBridge.isCategoryEnabled(
|
||||
browserContextHandle, ContentSettingsType.AUTO_DARK_WEB_CONTENT);
|
||||
resource = R.string.website_settings_add_site_description_auto_dark_block;
|
||||
+ } else if (mCategory.showSites(SiteSettingsCategory.Type.TIMEZONE_OVERRIDE)) {
|
||||
+ resource = R.string.website_settings_category_timezone_override_allowed;
|
||||
}
|
||||
assert resource > 0;
|
||||
return getString(resource);
|
||||
@@ -629,6 +650,13 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
if (resource == 0)
|
||||
resource = BromiteCustomContentSettingImpl.getAddExceptionDialogMessage(mCategory);
|
||||
@@ -639,6 +660,13 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
if (mCategory.showSites(SiteSettingsCategory.Type.COOKIES) && mRequiresFourStateSetting) {
|
||||
setting = cookieSettingsExceptionShouldBlock() ? ContentSettingValues.BLOCK
|
||||
: ContentSettingValues.ALLOW;
|
||||
|
@ -418,32 +403,28 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
} else {
|
||||
setting = (WebsitePreferenceBridge.isCategoryEnabled(
|
||||
browserContextHandle, mCategory.getContentSettingsType()))
|
||||
@@ -685,6 +713,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
@@ -695,6 +723,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
&& !WebsitePreferenceBridge.isCategoryEnabled(
|
||||
browserContextHandle, ContentSettingsType.AUTOMATIC_DOWNLOADS)) {
|
||||
allowSpecifyingExceptions = true;
|
||||
+ } else if (mCategory.showSites(SiteSettingsCategory.Type.TIMEZONE_OVERRIDE)) {
|
||||
+ allowSpecifyingExceptions = true;
|
||||
}
|
||||
if (allowSpecifyingExceptions) {
|
||||
getPreferenceScreen().addPreference(new AddExceptionPreference(getStyledContext(),
|
||||
@@ -856,7 +886,14 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
TriStateSiteSettingsPreference triStateToggle =
|
||||
(TriStateSiteSettingsPreference) getPreferenceScreen().findPreference(
|
||||
TRI_STATE_TOGGLE_KEY);
|
||||
- return (triStateToggle.getCheckedSetting() == ContentSettingValues.BLOCK);
|
||||
+ if (triStateToggle != null)
|
||||
+ return (triStateToggle.getCheckedSetting() == ContentSettingValues.BLOCK);
|
||||
+
|
||||
} else {
|
||||
Boolean allow = BromiteCustomContentSettingImpl.allowSpecifyingExceptions(mCategory);
|
||||
if (allow != null) allowSpecifyingExceptions = (boolean)allow;
|
||||
@@ -873,6 +903,11 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
Boolean blocked = BromiteCustomContentSettingImpl.considerException(mCategory, triStateToggle.getCheckedSetting());
|
||||
if (blocked != null) return (boolean)blocked;
|
||||
}
|
||||
+ TimezoneOverrideSiteSettingsPreference timeOverrideStatePreference =
|
||||
+ (TimezoneOverrideSiteSettingsPreference) getPreferenceScreen().findPreference(
|
||||
+ TIMEOVERRIDE_STATE_TOGGLE_KEY);
|
||||
+ if (timeOverrideStatePreference != null)
|
||||
+ return (timeOverrideStatePreference.getCheckedSetting() != ContentSettingValues.ALLOW);
|
||||
return (triStateToggle.getCheckedSetting() == ContentSettingValues.BLOCK);
|
||||
} else if (mRequiresFourStateSetting) {
|
||||
FourStateCookieSettingsPreference fourStateCookieToggle =
|
||||
(FourStateCookieSettingsPreference) getPreferenceScreen().findPreference(
|
||||
@@ -885,6 +922,9 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
@@ -902,6 +937,9 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
(FourStateCookieSettingsPreference) screen.findPreference(
|
||||
FOUR_STATE_COOKIE_TOGGLE_KEY);
|
||||
// TODO(crbug.com/1104836): Remove the old third-party cookie blocking UI
|
||||
|
@ -453,7 +434,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
Preference notificationsVibrate = screen.findPreference(NOTIFICATIONS_VIBRATE_TOGGLE_KEY);
|
||||
Preference notificationsQuietUi = screen.findPreference(NOTIFICATIONS_QUIET_UI_TOGGLE_KEY);
|
||||
Preference explainProtectedMediaKey = screen.findPreference(EXPLAIN_PROTECTED_MEDIA_KEY);
|
||||
@@ -896,20 +936,32 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
@@ -913,20 +951,32 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
if (mRequiresTriStateSetting) {
|
||||
screen.removePreference(binaryToggle);
|
||||
screen.removePreference(fourStateCookieToggle);
|
||||
|
@ -484,11 +465,11 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
+ if (!(mCategory.showSites(SiteSettingsCategory.Type.TIMEZONE_OVERRIDE))) {
|
||||
+ screen.removePreference(screen.findPreference(TIMEOVERRIDE_INFO_TEXT));
|
||||
+ }
|
||||
BromiteCustomContentSettingImpl.configureGlobalToggles(mCategory, screen);
|
||||
|
||||
if (permissionBlockedByOs) {
|
||||
maybeShowOsWarning(screen);
|
||||
@@ -1024,6 +1076,15 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
triStateToggle.initialize(setting, descriptionIds);
|
||||
@@ -1042,6 +1092,15 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
triStateToggle.initialize(contentType, setting, descriptionIds);
|
||||
}
|
||||
|
||||
+ private void configureTimeOverrideStateToggle(
|
||||
|
@ -503,7 +484,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
private void configureBinaryToggle(ChromeSwitchPreference binaryToggle, int contentType) {
|
||||
binaryToggle.setOnPreferenceChangeListener(this);
|
||||
binaryToggle.setTitle(ContentSettingsResources.getTitle(contentType));
|
||||
@@ -1107,9 +1168,11 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
@@ -1133,9 +1192,11 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
|
||||
|
||||
CharSequence[] descriptions = new String[2];
|
||||
descriptions[0] =
|
||||
|
@ -520,7 +501,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
|
||||
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
|
||||
@@ -132,6 +132,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
@@ -133,6 +133,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
return "popup_permission_list";
|
||||
case ContentSettingsType.SOUND:
|
||||
return "sound_permission_list";
|
||||
|
@ -529,42 +510,6 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
case ContentSettingsType.AR:
|
||||
return "ar_permission_list";
|
||||
case ContentSettingsType.MEDIASTREAM_CAMERA:
|
||||
@@ -891,11 +893,13 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
if (value == null) return;
|
||||
setUpPreferenceCommon(preference, value);
|
||||
|
||||
+ int content_type = getContentSettingsTypeFromPreferenceKey(preference.getKey());
|
||||
+
|
||||
ChromeSwitchPreference switchPreference = (ChromeSwitchPreference) preference;
|
||||
switchPreference.setChecked(value == ContentSettingValues.ALLOW);
|
||||
switchPreference.setSummary(isEmbargoed
|
||||
? getString(R.string.automatically_blocked)
|
||||
- : getString(ContentSettingsResources.getCategorySummary(value)));
|
||||
+ : getString(ContentSettingsResources.getCategorySummary(content_type, value)));
|
||||
switchPreference.setOnPreferenceChangeListener(this);
|
||||
@ContentSettingsType
|
||||
int contentType = getContentSettingsTypeFromPreferenceKey(preference.getKey());
|
||||
@@ -1114,7 +1118,7 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
|
||||
preference.setSummary(getDSECategorySummary(permission));
|
||||
} else {
|
||||
preference.setSummary(
|
||||
- getString(ContentSettingsResources.getCategorySummary(permission)));
|
||||
+ getString(ContentSettingsResources.getCategorySummary(type, permission)));
|
||||
}
|
||||
preference.setIcon(getContentSettingsIcon(type, permission));
|
||||
|
||||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java
|
||||
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java
|
||||
@@ -117,7 +117,7 @@ public class SiteSettings
|
||||
} else if (Type.AUTO_DARK_WEB_CONTENT == prefCategory) {
|
||||
p.setSummary(ContentSettingsResources.getAutoDarkWebContentListSummary(checked));
|
||||
} else if (requiresTriStateSetting) {
|
||||
- p.setSummary(ContentSettingsResources.getCategorySummary(setting));
|
||||
+ p.setSummary(ContentSettingsResources.getCategorySummary(contentType, setting));
|
||||
} else {
|
||||
p.setSummary(ContentSettingsResources.getCategorySummary(contentType, checked));
|
||||
}
|
||||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java
|
||||
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java
|
||||
|
@ -591,7 +536,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
}
|
||||
|
||||
private final BrowserContextHandle mBrowserContextHandle;
|
||||
@@ -198,6 +200,8 @@ public class SiteSettingsCategory {
|
||||
@@ -201,6 +203,8 @@ public class SiteSettingsCategory {
|
||||
return ContentSettingsType.USB_GUARD;
|
||||
case Type.VIRTUAL_REALITY:
|
||||
return ContentSettingsType.VR;
|
||||
|
@ -600,15 +545,15 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
// case Type.ALL_SITES
|
||||
// case Type.USE_STORAGE
|
||||
default:
|
||||
@@ -276,6 +280,8 @@ public class SiteSettingsCategory {
|
||||
@@ -279,6 +283,8 @@ public class SiteSettingsCategory {
|
||||
return "use_storage";
|
||||
case Type.VIRTUAL_REALITY:
|
||||
return "virtual_reality";
|
||||
+ case Type.TIMEZONE_OVERRIDE:
|
||||
+ return "timezone_override";
|
||||
default:
|
||||
assert false;
|
||||
return "";
|
||||
{
|
||||
String value = BromiteCustomContentSettingImpl.getPreferenceKey(type);
|
||||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsDelegate.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsDelegate.java
|
||||
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsDelegate.java
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsDelegate.java
|
||||
|
@ -834,9 +779,9 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
+ ContentSettingsType.TIMEZONE_OVERRIDE, getAddress().getHost(), value, "");
|
||||
+ setContentSettingException(type, exception);
|
||||
+ }
|
||||
}
|
||||
// We want to call setContentSetting even after explicitly setting
|
||||
// mContentSettingException above because this will trigger the actual change
|
||||
} else if (exception == null) {
|
||||
exception = BromiteCustomContentSettingImpl.createCustomException(type, value, getAddress());
|
||||
if (exception != null)
|
||||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java
|
||||
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java
|
||||
|
@ -867,7 +812,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
|
|||
+ case ContentSettingsType.TIMEZONE_OVERRIDE:
|
||||
+ return true;
|
||||
default:
|
||||
return false;
|
||||
return BromiteCustomContentSettingImpl.requiresTriStateContentSetting(contentSettingsType);
|
||||
}
|
||||
@@ -361,6 +363,14 @@ public class WebsitePreferenceBridge {
|
||||
contentSettingType, primaryPattern, secondaryPattern, setting);
|
||||
|
@ -1029,7 +974,7 @@ diff --git a/components/content_settings/core/browser/content_settings_pref_prov
|
|||
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
--- a/components/content_settings/core/browser/content_settings_registry.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
@@ -641,6 +641,18 @@ void ContentSettingsRegistry::Init() {
|
||||
@@ -643,6 +643,18 @@ void ContentSettingsRegistry::Init() {
|
||||
ContentSettingsInfo::INHERIT_IN_INCOGNITO,
|
||||
ContentSettingsInfo::PERSISTENT,
|
||||
ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS);
|
||||
|
|
Loading…
Add table
Reference in a new issue