Log Performance Intervention Notification Frequency

Introduces 3 new histograms to better gauge how often a performance
intervention will trigger or why it was unable to trigger. Two of these
metrics will provide a daily count on how often the performance
intervention notification was able to be shown or rate limited. The
final metric is an aggregate on the result of trying to trigger the
notification (i.e notification was shown or unable to show due to rate
limiting).

We also want these metrics to be recorded without showing the
Performance Intervention UI so this CL also introduces a separate flag
to gate the UI with.

Fixed: 342201412
Change-Id: I599294f1826acfbce6da8dcda2d50b1647f2c5e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5588155
Auto-Submit: Steven Luong <[email protected]>
Reviewed-by: David Trainor <[email protected]>
Reviewed-by: Joe Mason <[email protected]>
Reviewed-by: Alison Gale <[email protected]>
Reviewed-by: Eshwar Stalin <[email protected]>
Commit-Queue: Steven Luong <[email protected]>
Code-Coverage: [email protected] <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1312336}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index e55f7c4..7fd2fef41 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -78,16 +78,17 @@
 #include "chrome/browser/ui/browser_ui_prefs.h"
 #include "chrome/browser/ui/hats/hats_service_desktop.h"
 #include "chrome/browser/ui/network_profile_bubble.h"
+#include "chrome/browser/ui/performance_controls/performance_controls_metrics.h"
 #include "chrome/browser/ui/prefs/prefs_tab_helper.h"
 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h"
 #include "chrome/browser/ui/send_tab_to_self/send_tab_to_self_bubble.h"
-#include "chrome/browser/ui/views/side_panel/side_panel_prefs.h"
 #include "chrome/browser/ui/tabs/organization/prefs.h"
 #include "chrome/browser/ui/tabs/pinned_tab_codec.h"
 #include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_pref_names.h"
 #include "chrome/browser/ui/toolbar/chrome_labs/chrome_labs_prefs.h"
 #include "chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.h"
 #include "chrome/browser/ui/toolbar/toolbar_pref_names.h"
+#include "chrome/browser/ui/views/side_panel/side_panel_prefs.h"
 #include "chrome/browser/ui/webui/accessibility/accessibility_ui.h"
 #include "chrome/browser/ui/webui/bookmarks/bookmark_prefs.h"
 #include "chrome/browser/ui/webui/flags/flags_ui.h"
@@ -1766,6 +1767,7 @@
   media_router::RegisterLocalStatePrefs(registry);
   metrics::TabStatsTracker::RegisterPrefs(registry);
   performance_manager::user_tuning::prefs::RegisterLocalStatePrefs(registry);
+  PerformanceInterventionMetricsReporter::RegisterLocalStatePrefs(registry);
   RegisterBrowserPrefs(registry);
   speech::SodaInstaller::RegisterLocalStatePrefs(registry);
   StartupBrowserCreator::RegisterLocalStatePrefs(registry);