OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/notification_ui_manager.h" | 5 #include "chrome/browser/notifications/notification_ui_manager.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/notifications/message_center_notification_manager.h" | 9 #include "chrome/browser/notifications/message_center_notification_manager.h" |
10 #include "chrome/browser/notifications/message_center_settings_controller.h" | 10 #include "chrome/browser/notifications/message_center_settings_controller.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/profiles/profile_info_cache.h" | 12 #include "chrome/browser/profiles/profile_info_cache.h" |
13 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
14 | 14 |
15 // static | 15 // static |
16 NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) { | 16 NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) { |
| 17 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 18 if (!profile_manager) |
| 19 return nullptr; |
| 20 |
17 ProfileInfoCache* profile_info_cache = | 21 ProfileInfoCache* profile_info_cache = |
18 &g_browser_process->profile_manager()->GetProfileInfoCache(); | 22 &profile_manager->GetProfileInfoCache(); |
19 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider( | 23 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider( |
20 new MessageCenterSettingsController(profile_info_cache)); | 24 new MessageCenterSettingsController(profile_info_cache)); |
21 return new MessageCenterNotificationManager( | 25 return new MessageCenterNotificationManager( |
22 g_browser_process->message_center(), | 26 g_browser_process->message_center(), |
23 local_state, | 27 local_state, |
24 settings_provider.Pass()); | 28 settings_provider.Pass()); |
25 } | 29 } |
OLD | NEW |