[What's New] Create WhatsNew registrar for registering modules

whats_new_registrar.cc will be used as the place to register modules and
editions for What's New v2. The unit tests here make sure that all
histograms and actions have been created.

Bug: 354240504
Change-Id: Iad71704c15a97a17d816c6b2dfe6b1b5e5909813
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5725006
Reviewed-by: Yaron Friedman <[email protected]>
Reviewed-by: Dana Fried <[email protected]>
Commit-Queue: Mickey Burks <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1331392}
diff --git a/chrome/browser/global_desktop_features.h b/chrome/browser/global_desktop_features.h
index b71b9f83..59612c9 100644
--- a/chrome/browser/global_desktop_features.h
+++ b/chrome/browser/global_desktop_features.h
@@ -9,7 +9,9 @@
 #include "build/build_config.h"
 
 namespace whats_new {
+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
 class WhatsNewRegistry;
+#endif
 }  // namespace whats_new
 
 // This class owns the core controllers for features that are globally
@@ -35,9 +37,11 @@
   // Public accessors for features, e.g.
   // FooFeature* foo_feature() { return foo_feature_.get(); }
 
+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
   whats_new::WhatsNewRegistry* whats_new_registry() {
     return whats_new_registry_.get();
   }
+#endif
 
  protected:
   GlobalDesktopFeatures();
@@ -46,13 +50,17 @@
   // testing. e.g.
   // virtual std::unique_ptr<FooFeature> CreateFooFeature();
 
+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
   virtual std::unique_ptr<whats_new::WhatsNewRegistry> CreateWhatsNewRegistry();
+#endif
 
  private:
   // Features will each have a controller. e.g.
   // std::unique_ptr<FooFeature> foo_feature_;
 
+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
   std::unique_ptr<whats_new::WhatsNewRegistry> whats_new_registry_;
+#endif
 };
 
 #endif  // CHROME_BROWSER_GLOBAL_DESKTOP_FEATURES_H_