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

Unified Diff: ui/message_center/notification.cc

Issue 1292003004: Elide origins displayed on web notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove the use_origin flag in Notification do everything in NotificationView Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: ui/message_center/notification.cc
diff --git a/ui/message_center/notification.cc b/ui/message_center/notification.cc
index 6633a014d76038ea6676174cd3379cff2a10b5f9..e2820ebc4927730d4455101ce1c6eb728e7d0ddb 100644
--- a/ui/message_center/notification.cc
+++ b/ui/message_center/notification.cc
@@ -28,6 +28,7 @@ RichNotificationData::RichNotificationData()
: priority(DEFAULT_PRIORITY),
never_timeout(false),
timestamp(base::Time::Now()),
+ context_message(base::string16()),
progress(0),
should_make_spoken_feedback_for_popup_updates(true),
clickable(true),
@@ -57,6 +58,7 @@ Notification::Notification(NotificationType type,
const base::string16& message,
const gfx::Image& icon,
const base::string16& display_source,
+ const GURL& origin_url,
const NotifierId& notifier_id,
const RichNotificationData& optional_fields,
NotificationDelegate* delegate)
@@ -66,6 +68,7 @@ Notification::Notification(NotificationType type,
message_(message),
icon_(icon),
display_source_(display_source),
+ origin_url_(origin_url),
notifier_id_(notifier_id),
serial_number_(g_next_serial_number_++),
optional_fields_(optional_fields),
@@ -80,13 +83,13 @@ Notification::Notification(const std::string& id, const Notification& other)
message_(other.message_),
icon_(other.icon_),
display_source_(other.display_source_),
+ origin_url_(other.origin_url_),
notifier_id_(other.notifier_id_),
serial_number_(other.serial_number_),
optional_fields_(other.optional_fields_),
shown_as_popup_(other.shown_as_popup_),
is_read_(other.is_read_),
- delegate_(other.delegate_) {
-}
+ delegate_(other.delegate_) {}
Notification::Notification(const Notification& other)
: type_(other.type_),
@@ -95,6 +98,7 @@ Notification::Notification(const Notification& other)
message_(other.message_),
icon_(other.icon_),
display_source_(other.display_source_),
+ origin_url_(other.origin_url_),
notifier_id_(other.notifier_id_),
serial_number_(other.serial_number_),
optional_fields_(other.optional_fields_),
@@ -109,6 +113,7 @@ Notification& Notification::operator=(const Notification& other) {
message_ = other.message_;
icon_ = other.icon_;
display_source_ = other.display_source_;
+ origin_url_ = other.origin_url_;
notifier_id_ = other.notifier_id_;
serial_number_ = other.serial_number_;
optional_fields_ = other.optional_fields_;
@@ -152,17 +157,12 @@ scoped_ptr<Notification> Notification::CreateSystemNotification(
const gfx::Image& icon,
const std::string& system_component_id,
const base::Closure& click_callback) {
- scoped_ptr<Notification> notification(
- new Notification(
- NOTIFICATION_TYPE_SIMPLE,
- notification_id,
- title,
- message,
- icon,
- base::string16() /* display_source */,
- NotifierId(NotifierId::SYSTEM_COMPONENT, system_component_id),
- RichNotificationData(),
- new HandleNotificationClickedDelegate(click_callback)));
+ scoped_ptr<Notification> notification(new Notification(
+ NOTIFICATION_TYPE_SIMPLE, notification_id, title, message, icon,
+ base::string16() /* display_source */, GURL(),
+ NotifierId(NotifierId::SYSTEM_COMPONENT, system_component_id),
+ RichNotificationData(),
+ new HandleNotificationClickedDelegate(click_callback)));
notification->SetSystemPriority();
return notification.Pass();
}

Powered by Google App Engine
This is Rietveld 408576698