diff options
Diffstat (limited to 'chromium/ui/message_center/notification.h')
-rw-r--r-- | chromium/ui/message_center/notification.h | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/chromium/ui/message_center/notification.h b/chromium/ui/message_center/notification.h index bda6900fb0c..f61d6d60d60 100644 --- a/chromium/ui/message_center/notification.h +++ b/chromium/ui/message_center/notification.h @@ -15,6 +15,7 @@ #include "ui/message_center/message_center_export.h" #include "ui/message_center/notification_delegate.h" #include "ui/message_center/notification_types.h" +#include "ui/message_center/notifier_settings.h" namespace message_center { @@ -42,10 +43,12 @@ class MESSAGE_CENTER_EXPORT RichNotificationData { bool never_timeout; base::Time timestamp; string16 expanded_message; + string16 context_message; gfx::Image image; std::vector<NotificationItem> items; int progress; std::vector<ButtonInfo> buttons; + bool should_make_spoken_feedback_for_popup_updates; }; class MESSAGE_CENTER_EXPORT Notification { @@ -56,7 +59,7 @@ class MESSAGE_CENTER_EXPORT Notification { const string16& message, const gfx::Image& icon, const string16& display_source, - const std::string& extension_id, + const NotifierId& notifier_id, const RichNotificationData& optional_fields, NotificationDelegate* delegate); @@ -81,10 +84,8 @@ class MESSAGE_CENTER_EXPORT Notification { // A display string for the source of the notification. const string16& display_source() const { return display_source_; } - const std::string& extension_id() const { return extension_id_; } - void set_extension_id(const std::string& extension_id) { - extension_id_ = extension_id; - } + + const NotifierId& notifier_id() const { return notifier_id_; } // Begin unpacked values from optional_fields. int priority() const { return optional_fields_.priority; } @@ -102,6 +103,13 @@ class MESSAGE_CENTER_EXPORT Notification { optional_fields_.expanded_message = expanded_message; } + const string16& context_message() const { + return optional_fields_.context_message; + } + void set_context_message(const string16& context_message) { + optional_fields_.context_message = context_message; + } + const std::vector<NotificationItem>& items() const { return optional_fields_.items; } @@ -167,6 +175,16 @@ class MESSAGE_CENTER_EXPORT Notification { void ButtonClick(int index) const { delegate()->ButtonClick(index); } void Close(bool by_user) const { delegate()->Close(by_user); } + // Helper method to create a simple System notification. |click_callback| + // will be invoked when the notification is clicked. + static scoped_ptr<Notification> CreateSystemNotification( + const std::string& notification_id, + const base::string16& title, + const base::string16& message, + const gfx::Image& icon, + int system_component_id, + const base::Closure& click_callback); + protected: // The type of notification we'd like displayed. NotificationType type_; @@ -183,7 +201,7 @@ class MESSAGE_CENTER_EXPORT Notification { string16 display_source_; private: - std::string extension_id_; + NotifierId notifier_id_; unsigned serial_number_; RichNotificationData optional_fields_; bool shown_as_popup_; // True if this has been shown as a popup. |