1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_METRICS_NOTIFICATION_METRICS_LOGGER_FACTORY_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_METRICS_NOTIFICATION_METRICS_LOGGER_FACTORY_H_
7 
8 #include "base/memory/singleton.h"
9 #include "chrome/browser/notifications/metrics/notification_metrics_logger.h"
10 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
11 #include "content/public/browser/browser_context.h"
12 
13 class NotificationMetricsLogger;
14 
15 class NotificationMetricsLoggerFactory
16     : public BrowserContextKeyedServiceFactory {
17  public:
18   static NotificationMetricsLogger* GetForBrowserContext(
19       content::BrowserContext* browser_context);
20   static NotificationMetricsLoggerFactory* GetInstance();
21 
22   NotificationMetricsLoggerFactory(const NotificationMetricsLoggerFactory&) =
23       delete;
24   NotificationMetricsLoggerFactory& operator=(
25       const NotificationMetricsLoggerFactory&) = delete;
26 
27  private:
28   friend struct base::DefaultSingletonTraits<NotificationMetricsLoggerFactory>;
29 
30   NotificationMetricsLoggerFactory();
31 
32   // BrowserContextKeyedServiceFactory implementation.
33   KeyedService* BuildServiceInstanceFor(
34       content::BrowserContext* context) const override;
35   content::BrowserContext* GetBrowserContextToUse(
36       content::BrowserContext* context) const override;
37 };
38 
39 #endif  // CHROME_BROWSER_NOTIFICATIONS_METRICS_NOTIFICATION_METRICS_LOGGER_FACTORY_H_
40