fix: build failure when PDF viewer is disabled (#44964)

* fix: unused variable warning when the PDF viewer is disabled

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fix: unused function error when PDF viewer is disabled

error: unused function ParseManifest [-Werror,-Wunused-function]

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2024-12-06 17:28:55 -06:00 committed by GitHub
parent 2d45b7df34
commit cfe549c739
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -87,6 +87,7 @@ void ElectronExtensionSystem::InitForRegularProfile(bool extensions_enabled) {
management_policy_ = std::make_unique<ManagementPolicy>();
}
#if BUILDFLAG(ENABLE_PDF_VIEWER)
namespace {
std::unique_ptr<base::Value::Dict> ParseManifest(
@ -103,10 +104,11 @@ std::unique_ptr<base::Value::Dict> ParseManifest(
}
} // namespace
#endif // if BUILDFLAG(ENABLE_PDF_VIEWER)
void ElectronExtensionSystem::LoadComponentExtensions() {
std::string utf8_error;
#if BUILDFLAG(ENABLE_PDF_VIEWER)
std::string utf8_error;
std::string pdf_manifest_string = pdf_extension_util::GetManifest();
std::unique_ptr<base::Value::Dict> pdf_manifest =
ParseManifest(pdf_manifest_string);