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

Unified Diff: ui/message_center/views/notification_view.h

Issue 75133006: Move knowledge about MessageCenter out of MessageView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fix Created 7 years, 1 month 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
« no previous file with comments | « ui/message_center/views/message_view.cc ('k') | ui/message_center/views/notification_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/notification_view.h
diff --git a/ui/message_center/views/notification_view.h b/ui/message_center/views/notification_view.h
index c27037b0cfd67819f2d0a5280d404f0469a06484..6621ecda13ed0cecd60c7f6b7c7b3067f3224cae 100644
--- a/ui/message_center/views/notification_view.h
+++ b/ui/message_center/views/notification_view.h
@@ -18,6 +18,7 @@ namespace message_center {
class BoundedLabel;
class MessageCenter;
+class NotificationView;
class PaddedButton;
// View that displays all current types of notification (web, basic, image, and
@@ -32,11 +33,11 @@ class MESSAGE_CENTER_EXPORT NotificationView : public MessageView {
// notification type. A notification is top level if it needs to be rendered
// outside the browser window. No custom shadows are created for top level
// notifications on Linux with Aura.
- static MessageView* Create(const Notification& notification,
- MessageCenter* message_center,
- MessageCenterTray* tray,
- bool expanded,
- bool top_level);
+ static NotificationView* Create(const Notification& notification,
+ MessageCenter* message_center,
+ MessageCenterTray* tray,
+ bool expanded,
+ bool top_level);
virtual ~NotificationView();
@@ -53,12 +54,20 @@ class MESSAGE_CENTER_EXPORT NotificationView : public MessageView {
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE;
+ std::string notification_id() { return notification_id_; }
+
protected:
NotificationView(const Notification& notification,
MessageCenter* message_center,
MessageCenterTray* tray,
bool expanded);
+ // Overrides from base class MessageView:
+ virtual void ClickOnNotification() OVERRIDE;
+ virtual void RemoveNotification(bool by_user) OVERRIDE;
+ virtual void DisableNotificationsFromThisSource() OVERRIDE;
+ virtual void ShowNotifierSettingsBubble() OVERRIDE;
+
private:
bool IsExpansionNeeded(int width);
bool IsMessageExpansionNeeded(int width);
@@ -66,6 +75,11 @@ class MESSAGE_CENTER_EXPORT NotificationView : public MessageView {
int GetMessageLines(int width, int limit);
int GetMessageHeight(int width, int limit);
+ MessageCenter* message_center_; // Weak.
+ MessageCenterTray* tray_; // Weak.
+ std::string notification_id_;
+ message_center::NotifierId notifier_id_;
+
// Describes whether the view should display a hand pointer or not.
bool clickable_;
bool is_expanded_;
« no previous file with comments | « ui/message_center/views/message_view.cc ('k') | ui/message_center/views/notification_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698