Commit 522e7d29 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Inititialize fields in message_center::Notification's default ctor.

The default ctor is used for mojo. These fields are not copied over so
they need to be initialized.

Bug: 824097
Change-Id: I2f37acfbc36790c53064d2c467989878674c6e43
Reviewed-on: https://chromium-review.googlesource.com/973541Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544799}
parent d29aaee1
...@@ -61,7 +61,7 @@ RichNotificationData::RichNotificationData(const RichNotificationData& other) = ...@@ -61,7 +61,7 @@ RichNotificationData::RichNotificationData(const RichNotificationData& other) =
RichNotificationData::~RichNotificationData() = default; RichNotificationData::~RichNotificationData() = default;
Notification::Notification() = default; Notification::Notification() : serial_number_(g_next_serial_number++) {}
Notification::Notification(NotificationType type, Notification::Notification(NotificationType type,
const std::string& id, const std::string& id,
...@@ -83,8 +83,6 @@ Notification::Notification(NotificationType type, ...@@ -83,8 +83,6 @@ Notification::Notification(NotificationType type,
notifier_id_(notifier_id), notifier_id_(notifier_id),
optional_fields_(optional_fields), optional_fields_(optional_fields),
serial_number_(g_next_serial_number++), serial_number_(g_next_serial_number++),
shown_as_popup_(false),
is_read_(false),
delegate_(std::move(delegate)) {} delegate_(std::move(delegate)) {}
Notification::Notification(const std::string& id, const Notification& other) Notification::Notification(const std::string& id, const Notification& other)
......
...@@ -506,8 +506,8 @@ class MESSAGE_CENTER_PUBLIC_EXPORT Notification { ...@@ -506,8 +506,8 @@ class MESSAGE_CENTER_PUBLIC_EXPORT Notification {
// TODO(estade): these book-keeping fields should be moved into // TODO(estade): these book-keeping fields should be moved into
// NotificationList. // NotificationList.
unsigned serial_number_; unsigned serial_number_;
bool shown_as_popup_; // True if this has been shown as a popup. bool shown_as_popup_ = false; // True if this has been shown as a popup.
bool is_read_; // True if this has been seen in the message center. bool is_read_ = false; // True if this has been seen in the message center.
// A proxy object that allows access back to the JavaScript object that // A proxy object that allows access back to the JavaScript object that
// represents the notification, for firing events. // represents the notification, for firing events.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment