Skip to content

Commit

Permalink
fix: build failure when PDF viewer is disabled (electron#44960)
Browse files Browse the repository at this point in the history
* fix: unused variable warning when the PDF viewer is disabled

* fix: unused function error  when PDF viewer is disabled

error: unused function ParseManifest [-Werror,-Wunused-function]
  • Loading branch information
ckerr authored Dec 6, 2024
1 parent 208dc56 commit 578c1e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shell/browser/extensions/electron_extension_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);
Expand Down

0 comments on commit 578c1e5

Please sign in to comment.