Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Unified Diff: chrome/browser/metrics/chrome_metrics_service_client.h

Issue 2567263003: Basic UkmService implementation (Closed)
Patch Set: Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/metrics/chrome_metrics_service_client.h
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.h b/chrome/browser/metrics/chrome_metrics_service_client.h
index 3f6d57d332cdfd242793a50f4b4a6f63004987d3..bf7e3b6fe8c443ed77427e722ade8d98e34c970b 100644
--- a/chrome/browser/metrics/chrome_metrics_service_client.h
+++ b/chrome/browser/metrics/chrome_metrics_service_client.h
@@ -22,6 +22,7 @@
#include "components/metrics/profiler/tracking_synchronizer_observer.h"
#include "components/metrics/proto/system_profile.pb.h"
#include "components/omnibox/browser/omnibox_event_global_tracker.h"
+#include "components/ukm/observers/history_delete_observer.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "ppapi/features/features.h"
@@ -30,6 +31,7 @@ class AntiVirusMetricsProvider;
class ChromeOSMetricsProvider;
class GoogleUpdateMetricsProviderWin;
class PluginMetricsProvider;
+class Profile;
class PrefRegistrySimple;
namespace browser_watcher {
@@ -45,10 +47,10 @@ class ProfilerMetricsProvider;
// ChromeMetricsServiceClient provides an implementation of MetricsServiceClient
// that depends on chrome/.
-class ChromeMetricsServiceClient
- : public metrics::MetricsServiceClient,
- public metrics::TrackingSynchronizerObserver,
- public content::NotificationObserver {
+class ChromeMetricsServiceClient : public metrics::MetricsServiceClient,
+ public metrics::TrackingSynchronizerObserver,
+ public content::NotificationObserver,
+ public ukm::HistoryDeleteObserver {
public:
~ChromeMetricsServiceClient() override;
@@ -61,6 +63,7 @@ class ChromeMetricsServiceClient
// metrics::MetricsServiceClient:
metrics::MetricsService* GetMetricsService() override;
+ ukm::UkmService* GetUkmService() override;
void SetMetricsClientId(const std::string& client_id) override;
int32_t GetProduct() override;
std::string GetApplicationLocale() override;
@@ -83,6 +86,9 @@ class ChromeMetricsServiceClient
metrics::EnableMetricsDefault GetMetricsReportingDefaultState() override;
bool IsUMACellularUploadLogicEnabled() override;
+ // ukm::HistoryDeleteObserver
+ void OnHistoryDeleted() override;
+
// Persistent browser metrics need to be persisted somewhere. This constant
// provides a known string to be used for both the allocator's internal name
// and for a file on disk (relative to chrome::DIR_USER_DATA) to which they
@@ -129,6 +135,9 @@ class ChromeMetricsServiceClient
// there was recent activity.
void RegisterForNotifications();
+ // Call to listen for history deletions by the selected profile.
+ void RegisterForHistoryDeletions(Profile* profile);
+
// content::NotificationObserver:
void Observe(int type,
const content::NotificationSource& source,
@@ -151,6 +160,9 @@ class ChromeMetricsServiceClient
// The MetricsService that |this| is a client of.
std::unique_ptr<metrics::MetricsService> metrics_service_;
+ // The UkmService that |this| is a client of.
+ std::unique_ptr<ukm::UkmService> ukm_service_;
+
content::NotificationRegistrar registrar_;
#if defined(OS_CHROMEOS)

Powered by Google App Engine
This is Rietveld 408576698