Add buildflag for when in-product help is enabled for desktop platforms.
FeatureEngagement libraries and instances are only created through "if checks" of checking
whether the desktop platform is Windows and Linux. However, OS_LINUX contains OS_CHROMEOS
making the if check longer and not very intuitive. Thus I created a
"ENABLE_DESKTOP_IN_PRODUCT_HELP" flag to make it more readable and intuitive when including
the necessary libraries and instances.
Bug: 734132
Change-Id: I860ae27b1c3e7cc79ce6732752eabec0441c6843
Reviewed-on: https://chromium-review.googlesource.com/657742
Commit-Queue: Bettina Dea <[email protected]>
Reviewed-by: Robert Liao <[email protected]>
Reviewed-by: Brett Wilson <[email protected]>
Reviewed-by: Tommy Nyquist <[email protected]>
Reviewed-by: Peter Kasting <[email protected]>
Cr-Commit-Position: refs/heads/master@{#502512}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 7deef89..1d56ca9 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -76,6 +76,7 @@
#include "components/certificate_transparency/ct_policy_manager.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/dom_distiller/core/distilled_page_prefs.h"
+#include "components/feature_engagement/features.h"
#include "components/flags_ui/pref_service_flags_storage.h"
#include "components/gcm_driver/gcm_channel_status_syncer.h"
#include "components/language/core/browser/url_language_histogram.h"
@@ -165,6 +166,10 @@
#include "chrome/browser/ui/webui/local_discovery/local_discovery_ui.h"
#endif
+#if BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP)
+#include "chrome/browser/feature_engagement/session_duration_updater.h"
+#endif
+
#if defined(OS_ANDROID)
#include "chrome/browser/android/bookmarks/partner_bookmarks_shim.h"
#include "chrome/browser/android/ntp/content_suggestions_notifier_service.h"
@@ -265,9 +270,6 @@
#include "chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion_util.h"
#endif
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && !defined(OS_MACOSX)
-#include "chrome/browser/feature_engagement/session_duration_updater.h"
-#endif
#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
#include "chrome/browser/ui/startup/default_browser_prompt.h"
#endif
@@ -521,6 +523,10 @@
extensions::RuntimeAPI::RegisterPrefs(registry);
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP)
+ feature_engagement::SessionDurationUpdater::RegisterProfilePrefs(registry);
+#endif
+
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
printing::StickySettings::RegisterProfilePrefs(registry);
#endif
@@ -586,10 +592,6 @@
default_apps::RegisterProfilePrefs(registry);
#endif
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && !defined(OS_MACOSX)
- feature_engagement::SessionDurationUpdater::RegisterProfilePrefs(registry);
-#endif
-
#if defined(OS_CHROMEOS)
arc::prefs::RegisterProfilePrefs(registry);
chromeos::first_run::RegisterProfilePrefs(registry);