Avi Drissman | 4a8573c | 2022-09-09 19:35:54 | [diff] [blame] | 1 | // Copyright 2017 The Chromium Authors |
skym | 512bdb1 | 2017-05-10 15:17:13 | [diff] [blame] | 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_SYNC_USER_EVENT_SERVICE_FACTORY_H_ |
| 6 | #define CHROME_BROWSER_SYNC_USER_EVENT_SERVICE_FACTORY_H_ |
| 7 | |
Mikel Astiz | 128448a | 2023-06-01 17:50:36 | [diff] [blame] | 8 | #include "base/no_destructor.h" |
Ryan Sultanem | 7d0bbadf | 2022-08-22 16:21:18 | [diff] [blame] | 9 | #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
skym | 512bdb1 | 2017-05-10 15:17:13 | [diff] [blame] | 10 | |
| 11 | class Profile; |
| 12 | |
| 13 | namespace syncer { |
| 14 | class UserEventService; |
| 15 | } // namespace syncer |
| 16 | |
| 17 | namespace browser_sync { |
| 18 | |
Ryan Sultanem | 7d0bbadf | 2022-08-22 16:21:18 | [diff] [blame] | 19 | class UserEventServiceFactory : public ProfileKeyedServiceFactory { |
skym | 512bdb1 | 2017-05-10 15:17:13 | [diff] [blame] | 20 | public: |
| 21 | static syncer::UserEventService* GetForProfile(Profile* profile); |
| 22 | static UserEventServiceFactory* GetInstance(); |
| 23 | |
Peter Boström | fadb175 | 2021-09-30 19:17:01 | [diff] [blame] | 24 | UserEventServiceFactory(const UserEventServiceFactory&) = delete; |
| 25 | UserEventServiceFactory& operator=(const UserEventServiceFactory&) = delete; |
| 26 | |
skym | 512bdb1 | 2017-05-10 15:17:13 | [diff] [blame] | 27 | private: |
Mikel Astiz | 128448a | 2023-06-01 17:50:36 | [diff] [blame] | 28 | friend base::NoDestructor<UserEventServiceFactory>; |
skym | 512bdb1 | 2017-05-10 15:17:13 | [diff] [blame] | 29 | |
| 30 | UserEventServiceFactory(); |
| 31 | ~UserEventServiceFactory() override; |
| 32 | |
| 33 | // BrowserContextKeyedServiceFactory: |
Arthur Milchior | 0816385a | 2024-11-04 14:58:27 | [diff] [blame] | 34 | std::unique_ptr<KeyedService> BuildServiceInstanceForBrowserContext( |
skym | 512bdb1 | 2017-05-10 15:17:13 | [diff] [blame] | 35 | content::BrowserContext* context) const override; |
skym | 512bdb1 | 2017-05-10 15:17:13 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | } // namespace browser_sync |
| 39 | |
| 40 | #endif // CHROME_BROWSER_SYNC_USER_EVENT_SERVICE_FACTORY_H_ |