Convert NOTIFICATION_APP_TERMINATING to use callback in c/b/ui
We are in the process of eliminating NOTIFICATION_APP_TERMINATING. This
CL converts listeners in //chrome/browser/notifications to instead
use browser_shutdown::AddOnAppTerminatingCallback().
Bug: 1317628
Change-Id: I744c9a90917c621424aa6b4ae74c8df1e8cd254a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3653366
Commit-Queue: Jinho Bang <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1006219}
diff --git a/chrome/browser/ui/uma_browsing_activity_observer.h b/chrome/browser/ui/uma_browsing_activity_observer.h
index f96f74da..fddf5e4e 100644
--- a/chrome/browser/ui/uma_browsing_activity_observer.h
+++ b/chrome/browser/ui/uma_browsing_activity_observer.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_UMA_BROWSING_ACTIVITY_OBSERVER_H_
#define CHROME_BROWSER_UI_UMA_BROWSING_ACTIVITY_OBSERVER_H_
+#include "base/callback_list.h"
#include "chrome/browser/ui/tabs/tab_strip_model_stats_recorder.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -31,6 +32,8 @@
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
+ void OnAppTerminating() const;
+
// Calculates the time from an update being visible to the browser and
// the browser restarting or quitting and logs it.
void LogTimeBeforeUpdate() const;
@@ -50,6 +53,7 @@
content::NotificationRegistrar registrar_;
TabStripModelStatsRecorder tab_recorder_;
+ base::CallbackListSubscription subscription_;
};
} // namespace chrome