summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/notification.cc
blob: d182c6b58562ffcc9c5988835bf6d91e749c95b3 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright (c) 2012 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.h"

Notification::Notification(const GURL& origin_url,
                           const base::string16& title,
                           const base::string16& body,
                           const gfx::Image& icon,
                           const base::string16& display_source,
                           const base::string16& replace_id,
                           NotificationDelegate* delegate)
    : message_center::Notification(message_center::NOTIFICATION_TYPE_SIMPLE,
                                   delegate->id(),
                                   title,
                                   body,
                                   icon,
                                   display_source,
                                   message_center::NotifierId(origin_url),
                                   message_center::RichNotificationData(),
                                   delegate),
      origin_url_(origin_url),
      replace_id_(replace_id),
      delegate_(delegate) {}

Notification::Notification(
    message_center::NotificationType type,
    const GURL& origin_url,
    const base::string16& title,
    const base::string16& body,
    const gfx::Image& icon,
    blink::WebTextDirection dir,
    const message_center::NotifierId& notifier_id,
    const base::string16& display_source,
    const base::string16& replace_id,
    const message_center::RichNotificationData& rich_notification_data,
    NotificationDelegate* delegate)
    : message_center::Notification(type,
                                   delegate->id(),
                                   title,
                                   body,
                                   icon,
                                   display_source,
                                   notifier_id,
                                   rich_notification_data,
                                   delegate),
      origin_url_(origin_url),
      replace_id_(replace_id),
      delegate_(delegate) {}

Notification::Notification(const std::string& id,
                           const Notification& notification)
    : message_center::Notification(id, notification),
      origin_url_(notification.origin_url()),
      replace_id_(notification.replace_id()),
      delegate_(notification.delegate()) {
}

Notification::Notification(const Notification& notification)
    : message_center::Notification(notification),
      origin_url_(notification.origin_url()),
      replace_id_(notification.replace_id()),
      delegate_(notification.delegate()) {}

Notification::~Notification() {}

Notification& Notification::operator=(const Notification& notification) {
  message_center::Notification::operator=(notification);
  origin_url_ = notification.origin_url();
  replace_id_ = notification.replace_id();
  delegate_ = notification.delegate();
  return *this;
}