Commit 244db525 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Wrap more Pepper/PDF code with ENABLE_{PDF,PLUGINS} buildflags.

- Consolidate Pepper code within a BUILDFLAG(ENABLE_PLUGINS) section
  in browser_prefs.cc.
- Make AddStringsForPdf() a no-op if BUILDFLAG(ENABLE_PDF) is not set in
  resources_private_api.cc.

Bug: 1027360
Change-Id: Ie99dcc278d3b30282f4215e36ac95a6434fa0ebf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2017663Reviewed-by: default avatarDaniel Hosseinian <dhoss@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734664}
parent c618b6f3
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "chrome/browser/extensions/api/resources_private/resources_private_api.h" #include "chrome/browser/extensions/api/resources_private/resources_private_api.h"
#include <memory>
#include <string> #include <string>
#include <utility> #include <utility>
...@@ -42,6 +43,7 @@ void AddStringsForIdentity(base::DictionaryValue* dict) { ...@@ -42,6 +43,7 @@ void AddStringsForIdentity(base::DictionaryValue* dict) {
} }
void AddStringsForPdf(base::DictionaryValue* dict) { void AddStringsForPdf(base::DictionaryValue* dict) {
#if BUILDFLAG(ENABLE_PDF)
static constexpr webui::LocalizedString kPdfResources[] = { static constexpr webui::LocalizedString kPdfResources[] = {
{"passwordDialogTitle", IDS_PDF_PASSWORD_DIALOG_TITLE}, {"passwordDialogTitle", IDS_PDF_PASSWORD_DIALOG_TITLE},
{"passwordPrompt", IDS_PDF_NEED_PASSWORD}, {"passwordPrompt", IDS_PDF_NEED_PASSWORD},
...@@ -117,6 +119,7 @@ void AddStringsForPdf(base::DictionaryValue* dict) { ...@@ -117,6 +119,7 @@ void AddStringsForPdf(base::DictionaryValue* dict) {
dict->SetString(resource.name, l10n_util::GetStringUTF16(resource.id)); dict->SetString(resource.name, l10n_util::GetStringUTF16(resource.id));
dict->SetString("presetZoomFactors", zoom::GetPresetZoomFactorsAsJSON()); dict->SetString("presetZoomFactors", zoom::GetPresetZoomFactorsAsJSON());
#endif // BUILDFLAG(ENABLE_PDF)
} }
void AddAdditionalDataForPdf(base::DictionaryValue* dict) { void AddAdditionalDataForPdf(base::DictionaryValue* dict) {
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include "chrome/browser/notifications/notification_channels_provider_android.h" #include "chrome/browser/notifications/notification_channels_provider_android.h"
#include "chrome/browser/notifications/notifier_state_tracker.h" #include "chrome/browser/notifications/notifier_state_tracker.h"
#include "chrome/browser/notifications/platform_notification_service_impl.h" #include "chrome/browser/notifications/platform_notification_service_impl.h"
#include "chrome/browser/pepper_flash_settings_manager.h"
#include "chrome/browser/permissions/quiet_notification_permission_ui_state.h" #include "chrome/browser/permissions/quiet_notification_permission_ui_state.h"
#include "chrome/browser/policy/developer_tools_policy_handler.h" #include "chrome/browser/policy/developer_tools_policy_handler.h"
#include "chrome/browser/policy/webusb_allow_devices_for_urls_policy_handler.h" #include "chrome/browser/policy/webusb_allow_devices_for_urls_policy_handler.h"
...@@ -62,7 +61,6 @@ ...@@ -62,7 +61,6 @@
#include "chrome/browser/profiles/profile_info_cache.h" #include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profiles_state.h" #include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/push_messaging/push_messaging_app_identifier.h" #include "chrome/browser/push_messaging/push_messaging_app_identifier.h"
#include "chrome/browser/renderer_host/pepper/device_id_fetcher.h"
#include "chrome/browser/rlz/chrome_rlz_tracker_delegate.h" #include "chrome/browser/rlz/chrome_rlz_tracker_delegate.h"
#include "chrome/browser/search/search.h" #include "chrome/browser/search/search.h"
#include "chrome/browser/sharing/sharing_sync_preference.h" #include "chrome/browser/sharing/sharing_sync_preference.h"
...@@ -187,8 +185,10 @@ ...@@ -187,8 +185,10 @@
#endif #endif
#if BUILDFLAG(ENABLE_PLUGINS) #if BUILDFLAG(ENABLE_PLUGINS)
#include "chrome/browser/pepper_flash_settings_manager.h"
#include "chrome/browser/plugins/plugin_info_host_impl.h" #include "chrome/browser/plugins/plugin_info_host_impl.h"
#include "chrome/browser/plugins/plugins_resource_service.h" #include "chrome/browser/plugins/plugins_resource_service.h"
#include "chrome/browser/renderer_host/pepper/device_id_fetcher.h"
#endif #endif
#if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY)
...@@ -882,6 +882,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, ...@@ -882,6 +882,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
#endif #endif
#if BUILDFLAG(ENABLE_PLUGINS) #if BUILDFLAG(ENABLE_PLUGINS)
DeviceIDFetcher::RegisterProfilePrefs(registry);
PepperFlashSettingsManager::RegisterProfilePrefs(registry);
PluginInfoHostImpl::RegisterUserPrefs(registry); PluginInfoHostImpl::RegisterUserPrefs(registry);
#endif #endif
...@@ -927,7 +929,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, ...@@ -927,7 +929,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
AppShortcutManager::RegisterProfilePrefs(registry); AppShortcutManager::RegisterProfilePrefs(registry);
browser_sync::ForeignSessionHandler::RegisterProfilePrefs(registry); browser_sync::ForeignSessionHandler::RegisterProfilePrefs(registry);
ChromeAuthenticatorRequestDelegate::RegisterProfilePrefs(registry); ChromeAuthenticatorRequestDelegate::RegisterProfilePrefs(registry);
DeviceIDFetcher::RegisterProfilePrefs(registry);
DevToolsWindow::RegisterProfilePrefs(registry); DevToolsWindow::RegisterProfilePrefs(registry);
enterprise_reporting::RegisterProfilePrefs(registry); enterprise_reporting::RegisterProfilePrefs(registry);
extensions::CommandService::RegisterProfilePrefs(registry); extensions::CommandService::RegisterProfilePrefs(registry);
...@@ -941,7 +942,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, ...@@ -941,7 +942,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
media_router::RegisterProfilePrefs(registry); media_router::RegisterProfilePrefs(registry);
NewTabUI::RegisterProfilePrefs(registry); NewTabUI::RegisterProfilePrefs(registry);
ntp_tiles::CustomLinksManagerImpl::RegisterProfilePrefs(registry); ntp_tiles::CustomLinksManagerImpl::RegisterProfilePrefs(registry);
PepperFlashSettingsManager::RegisterProfilePrefs(registry);
PinnedTabCodec::RegisterProfilePrefs(registry); PinnedTabCodec::RegisterProfilePrefs(registry);
PromoService::RegisterProfilePrefs(registry); PromoService::RegisterProfilePrefs(registry);
SearchSuggestService::RegisterProfilePrefs(registry); SearchSuggestService::RegisterProfilePrefs(registry);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment