OLD | NEW |
(Empty) | |
| 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_FEATURE_ENGAGEMENT_TRACKER_FEATURE_ENGAGEMENT_TRACKER_FAC
TORY_H_ |
| 6 #define CHROME_BROWSER_FEATURE_ENGAGEMENT_TRACKER_FEATURE_ENGAGEMENT_TRACKER_FAC
TORY_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 10 |
| 11 namespace base { |
| 12 template <typename T> |
| 13 struct DefaultSingletonTraits; |
| 14 } // namespace base |
| 15 |
| 16 namespace content { |
| 17 class BrowserContext; |
| 18 } // namespace content |
| 19 |
| 20 namespace feature_engagement_tracker { |
| 21 class FeatureEngagementTracker; |
| 22 } // namespace feature_engagement_tracker |
| 23 |
| 24 // FeatureEngagementTrackerFactory is the main client class for interaction with |
| 25 // the feature_engagement_tracker component. |
| 26 class FeatureEngagementTrackerFactory |
| 27 : public BrowserContextKeyedServiceFactory { |
| 28 public: |
| 29 // Returns singleton instance of FeatureEngagementTrackerFactory. |
| 30 static FeatureEngagementTrackerFactory* GetInstance(); |
| 31 |
| 32 // Returns the FeatureEngagementTracker associated with |context|. |
| 33 static feature_engagement_tracker::FeatureEngagementTracker* |
| 34 GetForBrowserContext(content::BrowserContext* context); |
| 35 |
| 36 private: |
| 37 friend struct base::DefaultSingletonTraits<FeatureEngagementTrackerFactory>; |
| 38 |
| 39 FeatureEngagementTrackerFactory(); |
| 40 ~FeatureEngagementTrackerFactory() override; |
| 41 |
| 42 // BrowserContextKeyedServiceFactory overrides: |
| 43 KeyedService* BuildServiceInstanceFor( |
| 44 content::BrowserContext* context) const override; |
| 45 content::BrowserContext* GetBrowserContextToUse( |
| 46 content::BrowserContext* context) const override; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(FeatureEngagementTrackerFactory); |
| 49 }; |
| 50 |
| 51 #endif // CHROME_BROWSER_FEATURE_ENGAGEMENT_TRACKER_FEATURE_ENGAGEMENT_TRACKER_
FACTORY_H_ |
OLD | NEW |