0

Add a feature flag to honor JavaScript content settings in PDFs

Add |chrome_pdf::features::kPdfHonorJsContentSettings| and the
corresponding UI in chrome://flags for enabling whether JavaScript
content settings get honored in PDFs.

The flag does not do anything yet.

Bug: 696650
Change-Id: Icaf97474617ad56ebc93c2e419e90b12c5385aed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2203480
Commit-Queue: Daniel Hosseinian <dhoss@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773482}
This commit is contained in:
Daniel Hosseinian
2020-05-30 04:19:42 +00:00
committed by Commit Bot
parent aa0b234df4
commit 7dab99486c
7 changed files with 25 additions and 0 deletions

@ -3848,6 +3848,11 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kPdfFormSaveDescription, kOsDesktop,
FEATURE_VALUE_TYPE(chrome_pdf::features::kSaveEditedPDFForm)},
{"pdf-honor-js-content-settings",
flag_descriptions::kPdfHonorJsContentSettingsName,
flag_descriptions::kPdfHonorJsContentSettingsDescription, kOsDesktop,
FEATURE_VALUE_TYPE(chrome_pdf::features::kPdfHonorJsContentSettings)},
{"pdf-two-up-view", flag_descriptions::kPdfTwoUpViewName,
flag_descriptions::kPdfTwoUpViewDescription, kOsDesktop,
FEATURE_VALUE_TYPE(chrome_pdf::features::kPDFTwoUpView)},

@ -3547,6 +3547,11 @@
"owners": [ "thestig" ],
"expiry_milestone": 89
},
{
"name": "pdf-honor-js-content-settings",
"owners": [ "dhoss", "tsepez" ],
"expiry_milestone": 90
},
{
"name": "pdf-two-up-view",
"owners": ["nigi", "thestig"],

@ -4089,6 +4089,12 @@ const char kPdfFormSaveName[] = "Save PDF Forms";
const char kPdfFormSaveDescription[] =
"Enable saving PDFs with filled form data.";
const char kPdfHonorJsContentSettingsName[] =
"Honor JavaScript content settings in PDFs";
const char kPdfHonorJsContentSettingsDescription[] =
"Enable whether an origin's JavaScript content settings are honored in "
"PDFs opened from that origin.";
const char kPdfTwoUpViewName[] = "PDF Two-up View";
const char kPdfTwoUpViewDescription[] =
"Enable a new option to display two pages side by side in the PDF viewer.";

@ -2420,6 +2420,9 @@ extern const char kPdfAnnotationsDescription[];
extern const char kPdfFormSaveName[];
extern const char kPdfFormSaveDescription[];
extern const char kPdfHonorJsContentSettingsName[];
extern const char kPdfHonorJsContentSettingsDescription[];
extern const char kPdfTwoUpViewName[];
extern const char kPdfTwoUpViewDescription[];

@ -21,6 +21,9 @@ const base::Feature kPDFAnnotations = {"PDFAnnotations",
#endif // defined(OS_CHROMEOS)
};
const base::Feature kPdfHonorJsContentSettings = {
"PdfHonorJsContentSettings", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kPDFTwoUpView = {"PDFTwoUpView",
base::FEATURE_DISABLED_BY_DEFAULT};

@ -16,6 +16,7 @@ namespace features {
extern const base::Feature kAccessiblePDFForm;
extern const base::Feature kAccessiblePDFHighlight;
extern const base::Feature kPDFAnnotations;
extern const base::Feature kPdfHonorJsContentSettings;
extern const base::Feature kPDFTwoUpView;
extern const base::Feature kPDFViewerUpdate;
extern const base::Feature kSaveEditedPDFForm;

@ -41462,6 +41462,7 @@ from previous Chrome versions.
<int value="1192913630" label="OfflinePagesBackgroundLoading:disabled"/>
<int value="1193385506" label="OmniboxLooseMaxLimitOnDedicatedRows:enabled"/>
<int value="1194496204" label="NewWallpaperPicker:enabled"/>
<int value="1194896796" label="PdfHonorJsContentSettings:disabled"/>
<int value="1195087468" label="ProminentDarkModeActiveTabTitle:enabled"/>
<int value="1196644408" label="performance-monitor-gathering"/>
<int value="1196834473" label="disable-smart-virtual-keyboard"/>
@ -41768,6 +41769,7 @@ from previous Chrome versions.
<int value="1529979182" label="EnablePasswordSelection:enabled"/>
<int value="1530113113" label="disable-pushstate-throttle"/>
<int value="1530177325" label="LanguagesPreference:disabled"/>
<int value="1530182188" label="PdfHonorJsContentSettings:enabled"/>
<int value="1531164533" label="SyncPseudoUSSFavicons:disabled"/>
<int value="1531741496" label="DragFromShelfToHomeOrOverview:disabled"/>
<int value="1534222388" label="EnableEphemeralFlashPermission:enabled"/>