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

Unified Diff: ui/message_center/notification.h

Issue 1292003004: Elide origins displayed on web notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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.h
diff --git a/ui/message_center/notification.h b/ui/message_center/notification.h
index 122cd6760629823e67d51cc789869a27269cad54..489255e0d95ee59bf88ae4f2b5511559b1ecae7f 100644
--- a/ui/message_center/notification.h
+++ b/ui/message_center/notification.h
@@ -33,6 +33,13 @@ struct MESSAGE_CENTER_EXPORT ButtonInfo {
ButtonInfo(const base::string16& title);
};
+struct MESSAGE_CENTER_EXPORT ContextMessage {
Jun Mukai 2015/08/14 17:17:07 I prefer to keep string16 for context message. Cou
Miguel Garcia 2015/08/14 18:28:45 Will give a shot, now that you mention it I recall
Jun Mukai 2015/08/17 18:36:14 string16 is the text representation on UI side, so
+ ContextMessage(std::string msg, bool origin)
+ : message(msg), is_origin(origin) {}
+ std::string message;
+ bool is_origin;
+};
+
class MESSAGE_CENTER_EXPORT RichNotificationData {
public:
RichNotificationData();
@@ -42,7 +49,7 @@ class MESSAGE_CENTER_EXPORT RichNotificationData {
int priority;
bool never_timeout;
base::Time timestamp;
- base::string16 context_message;
+ ContextMessage context_message;
gfx::Image image;
gfx::Image small_image;
std::vector<NotificationItem> items;
@@ -123,11 +130,13 @@ class MESSAGE_CENTER_EXPORT Notification {
optional_fields_.timestamp = timestamp;
}
- const base::string16& context_message() const {
+ const ContextMessage context_message() const {
return optional_fields_.context_message;
}
- void set_context_message(const base::string16& context_message) {
- optional_fields_.context_message = context_message;
+
+ void set_context_message(const std::string& context_message, bool is_origin) {
+ optional_fields_.context_message.message = context_message;
+ optional_fields_.context_message.is_origin = is_origin;
}
const std::vector<NotificationItem>& items() const {

Powered by Google App Engine
This is Rietveld 408576698