Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: chrome/browser/notifications/notification_ui_manager_desktop.cc

Issue 1657913003: Refactor of ProfileInfoCache in c/b/notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix errors Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <utility> 7 #include <utility>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/notifications/message_center_notification_manager.h" 11 #include "chrome/browser/notifications/message_center_notification_manager.h"
12 #include "chrome/browser/notifications/message_center_settings_controller.h" 12 #include "chrome/browser/notifications/message_center_settings_controller.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/profiles/profile_info_cache.h"
15 #include "chrome/browser/profiles/profile_manager.h" 14 #include "chrome/browser/profiles/profile_manager.h"
16 15
17 // static 16 // static
18 NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) { 17 NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) {
19 ProfileManager* profile_manager = g_browser_process->profile_manager(); 18 ProfileManager* profile_manager = g_browser_process->profile_manager();
20 if (!profile_manager) 19 if (!profile_manager)
21 return nullptr; 20 return nullptr;
22 21
23 ProfileInfoCache* profile_info_cache =
24 &profile_manager->GetProfileInfoCache();
25 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider( 22 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider(
26 new MessageCenterSettingsController(profile_info_cache)); 23 new MessageCenterSettingsController(
24 profile_manager->GetProfileAttributesStorage()));
27 return new MessageCenterNotificationManager( 25 return new MessageCenterNotificationManager(
28 g_browser_process->message_center(), 26 g_browser_process->message_center(),
29 std::move(settings_provider)); 27 std::move(settings_provider));
30 } 28 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698