OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_DRIVE_DRIVE_NOTIFICATION_MANAGER_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_DRIVE_DRIVE_NOTIFICATION_MANAGER_FACTORY_H_ |
6 #define CHROME_BROWSER_DRIVE_DRIVE_NOTIFICATION_MANAGER_FACTORY_H_ | 6 #define CHROME_BROWSER_DRIVE_DRIVE_NOTIFICATION_MANAGER_FACTORY_H_ |
7 | 7 |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "components/browser_context_keyed_service/browser_context_keyed_service
_factory.h" | 9 #include "components/browser_context_keyed_service/browser_context_keyed_service
_factory.h" |
10 | 10 |
11 class Profile; | 11 namespace content { |
| 12 class BrowserContext; |
| 13 } |
12 | 14 |
13 namespace drive { | 15 namespace drive { |
14 | 16 |
15 class DriveNotificationManager; | 17 class DriveNotificationManager; |
16 | 18 |
17 // Singleton that owns all DriveNotificationManager and associates them with | 19 // Singleton that owns all DriveNotificationManager and associates them with |
18 // profiles. | 20 // browser contexts. |
19 class DriveNotificationManagerFactory | 21 class DriveNotificationManagerFactory |
20 : public BrowserContextKeyedServiceFactory { | 22 : public BrowserContextKeyedServiceFactory { |
21 public: | 23 public: |
22 static DriveNotificationManager* GetForProfile(Profile* profile); | 24 static DriveNotificationManager* GetForBrowserContext( |
| 25 content::BrowserContext* context); |
23 | 26 |
24 static DriveNotificationManagerFactory* GetInstance(); | 27 static DriveNotificationManagerFactory* GetInstance(); |
25 | 28 |
26 private: | 29 private: |
27 friend struct DefaultSingletonTraits<DriveNotificationManagerFactory>; | 30 friend struct DefaultSingletonTraits<DriveNotificationManagerFactory>; |
28 | 31 |
29 DriveNotificationManagerFactory(); | 32 DriveNotificationManagerFactory(); |
30 virtual ~DriveNotificationManagerFactory(); | 33 virtual ~DriveNotificationManagerFactory(); |
31 | 34 |
32 // BrowserContextKeyedServiceFactory implementation. | 35 // BrowserContextKeyedServiceFactory implementation. |
33 virtual BrowserContextKeyedService* BuildServiceInstanceFor( | 36 virtual BrowserContextKeyedService* BuildServiceInstanceFor( |
34 content::BrowserContext* profile) const OVERRIDE; | 37 content::BrowserContext* context) const OVERRIDE; |
35 }; | 38 }; |
36 | 39 |
37 } // namespace drive | 40 } // namespace drive |
38 | 41 |
39 #endif // CHROME_BROWSER_DRIVE_DRIVE_NOTIFICATION_MANAGER_FACTORY_H_ | 42 #endif // CHROME_BROWSER_DRIVE_DRIVE_NOTIFICATION_MANAGER_FACTORY_H_ |
OLD | NEW |