diff --git a/shell/app/electron_content_client.cc b/shell/app/electron_content_client.cc index e6fb2f3f7b..ee91e67058 100644 --- a/shell/app/electron_content_client.cc +++ b/shell/app/electron_content_client.cc @@ -32,6 +32,7 @@ #if BUILDFLAG(ENABLE_PDF_VIEWER) #include "components/pdf/common/constants.h" // nogncheck +#include "components/pdf/common/pdf_util.h" // nogncheck #include "shell/common/electron_constants.h" #endif // BUILDFLAG(ENABLE_PDF_VIEWER) @@ -217,4 +218,13 @@ void ElectronContentClient::AddContentDecryptionModules( } } +bool ElectronContentClient::IsFilePickerAllowedForCrossOriginSubframe( + const url::Origin& origin) { +#if BUILDFLAG(ENABLE_PDF_VIEWER) + return IsPdfExtensionOrigin(origin); +#else + return false; +#endif +} + } // namespace electron diff --git a/shell/app/electron_content_client.h b/shell/app/electron_content_client.h index f833881b77..3c38e45ea5 100644 --- a/shell/app/electron_content_client.h +++ b/shell/app/electron_content_client.h @@ -9,6 +9,7 @@ #include #include "content/public/common/content_client.h" +#include "url/origin.h" namespace electron { @@ -33,6 +34,8 @@ class ElectronContentClient : public content::ContentClient { void AddContentDecryptionModules( std::vector* cdms, std::vector* cdm_host_file_paths) override; + bool IsFilePickerAllowedForCrossOriginSubframe( + const url::Origin& origin) override; }; } // namespace electron