| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/notifications/desktop_notification_service_factory.h" | 5 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/notifications/desktop_notification_service.h" | 8 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/profiles/profile_dependency_manager.h" | 10 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 | 12 |
| 13 using content::BrowserThread; |
| 14 |
| 13 // static | 15 // static |
| 14 DesktopNotificationService* DesktopNotificationServiceFactory::GetForProfile( | 16 DesktopNotificationService* DesktopNotificationServiceFactory::GetForProfile( |
| 15 Profile* profile) { | 17 Profile* profile) { |
| 16 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 18 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 17 return static_cast<DesktopNotificationService*>( | 19 return static_cast<DesktopNotificationService*>( |
| 18 GetInstance()->GetServiceForProfile(profile, true)); | 20 GetInstance()->GetServiceForProfile(profile, true)); |
| 19 } | 21 } |
| 20 | 22 |
| 21 // static | 23 // static |
| 22 DesktopNotificationServiceFactory* DesktopNotificationServiceFactory:: | 24 DesktopNotificationServiceFactory* DesktopNotificationServiceFactory:: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 35 Profile* profile) const { | 37 Profile* profile) const { |
| 36 DesktopNotificationService* service = new DesktopNotificationService(profile, | 38 DesktopNotificationService* service = new DesktopNotificationService(profile, |
| 37 g_browser_process->notification_ui_manager()); | 39 g_browser_process->notification_ui_manager()); |
| 38 | 40 |
| 39 return service; | 41 return service; |
| 40 } | 42 } |
| 41 | 43 |
| 42 bool DesktopNotificationServiceFactory::ServiceHasOwnInstanceInIncognito() { | 44 bool DesktopNotificationServiceFactory::ServiceHasOwnInstanceInIncognito() { |
| 43 return true; | 45 return true; |
| 44 } | 46 } |
| OLD | NEW |