0

Add PDF Searchify Save feature flag.

Add a feature flag to enable saving PDFs with extracted text by
Searchify feature. The flag will be used both in C++ and WebUI code.

Bug: 382610226
Change-Id: I1065e88f803a30f83a116b6996c6103b5009a5f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6075075
Auto-Submit: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1393156}
This commit is contained in:
Ramin Halavati
2024-12-06 21:32:03 +00:00
committed by Chromium LUCI CQ
parent 30ce6c1f75
commit 5993b0703c
3 changed files with 15 additions and 0 deletions

@ -264,6 +264,8 @@ void AddAdditionalData(bool enable_printing,
dict->Set("pdfUseShowSaveFilePicker",
base::FeatureList::IsEnabled(
chrome_pdf::features::kPdfUseShowSaveFilePicker));
dict->Set("pdfSearchifySaveEnabled",
chrome_pdf::features::IsPdfSearchifySaveEnabled());
}
bool MaybeDispatchSaveEvent(content::RenderFrameHost* embedder_host) {

@ -43,6 +43,10 @@ BASE_FEATURE(kPdfPortfolio, "PdfPortfolio", base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kPdfSearchify, "PdfSearchify", base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kPdfSearchifySave,
"PdfSearchifySave",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kPdfUseShowSaveFilePicker,
"PdfUseShowSaveFilePicker",
base::FEATURE_DISABLED_BY_DEFAULT);
@ -69,4 +73,9 @@ bool IsOopifPdfEnabled() {
base::FeatureList::IsEnabled(kPdfOopif);
}
bool IsPdfSearchifySaveEnabled() {
return base::FeatureList::IsEnabled(kPdfSearchify) &&
base::FeatureList::IsEnabled(kPdfSearchifySave);
}
} // namespace chrome_pdf::features

@ -23,6 +23,7 @@ BASE_DECLARE_FEATURE(kPdfPaintManagerDrawsBackground);
BASE_DECLARE_FEATURE(kPdfPartialLoading);
BASE_DECLARE_FEATURE(kPdfPortfolio);
BASE_DECLARE_FEATURE(kPdfSearchify);
BASE_DECLARE_FEATURE(kPdfSearchifySave);
BASE_DECLARE_FEATURE(kPdfUseShowSaveFilePicker);
BASE_DECLARE_FEATURE(kPdfUseSkiaRenderer);
BASE_DECLARE_FEATURE(kPdfXfaSupport);
@ -39,6 +40,9 @@ void SetIsOopifPdfPolicyEnabled(bool is_oopif_pdf_policy_enabled);
// PDF viewer should be used.
bool IsOopifPdfEnabled();
// Returns whether PDF Searchify and PDF Searchify Save features are enabled.
bool IsPdfSearchifySaveEnabled();
} // namespace chrome_pdf::features
#endif // PDF_PDF_FEATURES_H_