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 #include "chrome/browser/drive/drive_notification_manager_factory.h" | 5 #include "chrome/browser/drive/drive_notification_manager_factory.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" | 8 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/sync/profile_sync_service.h" | 10 #include "chrome/browser/sync/profile_sync_service.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 return NULL; | 36 return NULL; |
37 } | 37 } |
38 | 38 |
39 return static_cast<DriveNotificationManager*>( | 39 return static_cast<DriveNotificationManager*>( |
40 GetInstance()->GetServiceForBrowserContext(context, true)); | 40 GetInstance()->GetServiceForBrowserContext(context, true)); |
41 } | 41 } |
42 | 42 |
43 // static | 43 // static |
44 DriveNotificationManagerFactory* | 44 DriveNotificationManagerFactory* |
45 DriveNotificationManagerFactory::GetInstance() { | 45 DriveNotificationManagerFactory::GetInstance() { |
46 return Singleton<DriveNotificationManagerFactory>::get(); | 46 return base::Singleton<DriveNotificationManagerFactory>::get(); |
47 } | 47 } |
48 | 48 |
49 DriveNotificationManagerFactory::DriveNotificationManagerFactory() | 49 DriveNotificationManagerFactory::DriveNotificationManagerFactory() |
50 : BrowserContextKeyedServiceFactory( | 50 : BrowserContextKeyedServiceFactory( |
51 "DriveNotificationManager", | 51 "DriveNotificationManager", |
52 BrowserContextDependencyManager::GetInstance()) { | 52 BrowserContextDependencyManager::GetInstance()) { |
53 DependsOn(ProfileSyncServiceFactory::GetInstance()); | 53 DependsOn(ProfileSyncServiceFactory::GetInstance()); |
54 DependsOn(invalidation::ProfileInvalidationProviderFactory::GetInstance()); | 54 DependsOn(invalidation::ProfileInvalidationProviderFactory::GetInstance()); |
55 } | 55 } |
56 | 56 |
57 DriveNotificationManagerFactory::~DriveNotificationManagerFactory() {} | 57 DriveNotificationManagerFactory::~DriveNotificationManagerFactory() {} |
58 | 58 |
59 KeyedService* DriveNotificationManagerFactory::BuildServiceInstanceFor( | 59 KeyedService* DriveNotificationManagerFactory::BuildServiceInstanceFor( |
60 content::BrowserContext* context) const { | 60 content::BrowserContext* context) const { |
61 invalidation::ProfileInvalidationProvider* invalidation_provider = | 61 invalidation::ProfileInvalidationProvider* invalidation_provider = |
62 invalidation::ProfileInvalidationProviderFactory::GetForProfile( | 62 invalidation::ProfileInvalidationProviderFactory::GetForProfile( |
63 Profile::FromBrowserContext(context)); | 63 Profile::FromBrowserContext(context)); |
64 DCHECK(invalidation_provider); | 64 DCHECK(invalidation_provider); |
65 DCHECK(invalidation_provider->GetInvalidationService()); | 65 DCHECK(invalidation_provider->GetInvalidationService()); |
66 return new DriveNotificationManager( | 66 return new DriveNotificationManager( |
67 invalidation_provider->GetInvalidationService()); | 67 invalidation_provider->GetInvalidationService()); |
68 } | 68 } |
69 | 69 |
70 } // namespace drive | 70 } // namespace drive |
OLD | NEW |