| 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/google_apis/drive_notification_manager_factory.h" | 5 #include "chrome/browser/google_apis/drive_notification_manager_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/google_apis/drive_notification_manager.h" | 7 #include "chrome/browser/google_apis/drive_notification_manager.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/sync/profile_sync_service.h" | 9 #include "chrome/browser/sync/profile_sync_service.h" |
| 10 #include "chrome/browser/sync/profile_sync_service_factory.h" | 10 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 11 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 11 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
| 12 | 12 |
| 13 namespace google_apis { | 13 namespace google_apis { |
| 14 | 14 |
| 15 // static | 15 // static |
| 16 DriveNotificationManager* | 16 DriveNotificationManager* |
| 17 DriveNotificationManagerFactory::GetForProfile(Profile* profile) { | 17 DriveNotificationManagerFactory::GetForProfile(Profile* profile) { |
| 18 if (!ProfileSyncService::IsSyncEnabled()) | 18 if (!ProfileSyncService::IsSyncEnabled()) |
| 19 return NULL; | 19 return NULL; |
| 20 | 20 |
| 21 return static_cast<DriveNotificationManager*>( | 21 return static_cast<DriveNotificationManager*>( |
| 22 GetInstance()->GetServiceForProfile(profile, true)); | 22 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 23 } | 23 } |
| 24 | 24 |
| 25 // static | 25 // static |
| 26 DriveNotificationManagerFactory* | 26 DriveNotificationManagerFactory* |
| 27 DriveNotificationManagerFactory::GetInstance() { | 27 DriveNotificationManagerFactory::GetInstance() { |
| 28 return Singleton<DriveNotificationManagerFactory>::get(); | 28 return Singleton<DriveNotificationManagerFactory>::get(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 DriveNotificationManagerFactory::DriveNotificationManagerFactory() | 31 DriveNotificationManagerFactory::DriveNotificationManagerFactory() |
| 32 : ProfileKeyedServiceFactory("DriveNotificationManager", | 32 : BrowserContextKeyedServiceFactory("DriveNotificationManager", |
| 33 ProfileDependencyManager::GetInstance()) { | 33 BrowserContextDependencyManager::GetInstance())
{ |
| 34 DependsOn(ProfileSyncServiceFactory::GetInstance()); | 34 DependsOn(ProfileSyncServiceFactory::GetInstance()); |
| 35 } | 35 } |
| 36 | 36 |
| 37 DriveNotificationManagerFactory::~DriveNotificationManagerFactory() {} | 37 DriveNotificationManagerFactory::~DriveNotificationManagerFactory() {} |
| 38 | 38 |
| 39 ProfileKeyedService* DriveNotificationManagerFactory::BuildServiceInstanceFor( | 39 BrowserContextKeyedService* DriveNotificationManagerFactory::BuildServiceInstanc
eFor( |
| 40 content::BrowserContext* profile) const { | 40 content::BrowserContext* profile) const { |
| 41 return new DriveNotificationManager(static_cast<Profile*>(profile)); | 41 return new DriveNotificationManager(static_cast<Profile*>(profile)); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace google_apis | 44 } // namespace google_apis |
| OLD | NEW |