Repository: electron/electron
Pull request: fix: compilation error when disabling extensions and pdf_viewer

#### Description of Change
here we fix the compile error:
```
// args.gn file
enable_electron_extensions=false
enable_pdf_viewer=false
```
<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.

Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.md
-->

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
- [ ] relevant API documentation, tutorials, and examples are updated and follow the [documentation style guide](https://github.com/electron/electron/blob/main/docs/development/style-guide.md)
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: <!-- Please add a one-line description for app developers to read in the release notes, or 'none' if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/main/README.md#examples -->Fixed compilation error when disabling extensions and pdf_viewer


Changed files:
filename: shell/browser/plugins/plugin_utils.cc
patch: @@ -33,6 +33,7 @@ std::string PluginUtils::GetExtensionIdForMimeType(
 base::flat_map<std::string, std::string>
 PluginUtils::GetMimeTypeToExtensionIdMap(
     content::BrowserContext* browser_context) {
+  base::flat_map<std::string, std::string> mime_type_to_extension_id_map;
 #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
   const auto& allowed_extension_ids = MimeTypesHandler::GetMIMETypeAllowlist();
   if (allowed_extension_ids.empty())
@@ -41,8 +42,6 @@ PluginUtils::GetMimeTypeToExtensionIdMap(
   const extensions::ExtensionSet& enabled_extensions =
       extensions::ExtensionRegistry::Get(browser_context)->enabled_extensions();
 
-  base::flat_map<std::string, std::string> mime_type_to_extension_id_map;
-
   // Go through the white-listed extensions and try to use them to intercept
   // the URL request.
   for (const std::string& id : allowed_extension_ids) {

filename: shell/browser/printing/printing_utils.cc
patch: @@ -81,6 +81,7 @@ bool IsDeviceNameValid(const std::u16string& device_name) {
 
 namespace {
 
+#if BUILDFLAG(ENABLE_PDF_VIEWER)
 // Duplicated from chrome/browser/printing/print_view_manager_common.cc
 content::RenderFrameHost* GetFullPagePlugin(content::WebContents* contents) {
   content::RenderFrameHost* full_page_plugin = nullptr;
@@ -99,6 +100,7 @@ content::RenderFrameHost* GetFullPagePlugin(content::WebContents* contents) {
 #endif  // BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
   return full_page_plugin;
 }
+#endif  // BUILDFLAG(ENABLE_PDF_VIEWER)
 
 }  // namespace
 
@@ -119,7 +121,7 @@ content::RenderFrameHost* GetRenderFrameHostToUse(
   if (pdf_rfh) {
     return pdf_rfh;
   }
-#endif  // BUILDFLAG(ENABLE_PDF)
+#endif  // BUILDFLAG(ENABLE_PDF_VIEWER)
   auto* focused_frame = contents->GetFocusedFrame();
   return (focused_frame && focused_frame->HasSelection())
              ? focused_frame