summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/notification_ui_manager_desktop.cc
blob: 7de03bb53d8361c5a41735b617d5b224e4a34291 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/notifications/notification_ui_manager.h"

#include <utility>

#include "base/memory/scoped_ptr.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/notifications/message_center_notification_manager.h"
#include "chrome/browser/notifications/message_center_settings_controller.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"

// static
NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) {
  ProfileManager* profile_manager = g_browser_process->profile_manager();
  if (!profile_manager)
    return nullptr;

  scoped_ptr<message_center::NotifierSettingsProvider> settings_provider(
      new MessageCenterSettingsController(
          profile_manager->GetProfileAttributesStorage()));
  return new MessageCenterNotificationManager(
      g_browser_process->message_center(),
      std::move(settings_provider));
}