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

Unified Diff: ui/message_center/message_simple_view.cc

Issue 12277024: Notificaitons refactor step 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more feedback from Steven Created 7 years, 10 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
« no previous file with comments | « ui/message_center/message_simple_view.h ('k') | ui/message_center/message_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/message_simple_view.cc
diff --git a/ui/message_center/message_simple_view.cc b/ui/message_center/message_simple_view.cc
index 94e138422cba77b351aeef4ea3736a9dea1dc648..8f85b458ae119af6a4a91264ecf79f2fb5401ca5 100644
--- a/ui/message_center/message_simple_view.cc
+++ b/ui/message_center/message_simple_view.cc
@@ -31,6 +31,7 @@ MessageSimpleView::MessageSimpleView(
close->SetImageAlignment(views::ImageButton::ALIGN_CENTER,
views::ImageButton::ALIGN_MIDDLE);
old_style_close_button_.reset(close);
+ SetUpView(notification);
}
MessageSimpleView::~MessageSimpleView() {
@@ -59,20 +60,20 @@ gfx::Size MessageSimpleView::GetPreferredSize() {
return size;
}
-void MessageSimpleView::SetUpView() {
+void MessageSimpleView::SetUpView(const Notification& notification) {
views::ImageView* icon = new views::ImageView;
icon->SetImageSize(
gfx::Size(kWebNotificationIconSize, kWebNotificationIconSize));
- icon->SetImage(notification().primary_icon);
+ icon->SetImage(notification.primary_icon());
- views::Label* title = new views::Label(notification().title);
+ views::Label* title = new views::Label(notification.title());
title->SetHorizontalAlignment(gfx::ALIGN_LEFT);
title->SetFont(title->font().DeriveFont(0, gfx::Font::BOLD));
- views::Label* message = new views::Label(notification().message);
+ views::Label* message = new views::Label(notification.message());
message->SetHorizontalAlignment(gfx::ALIGN_LEFT);
message->SetMultiLine(true);
- SkColor bg_color = notification().is_read ?
+ SkColor bg_color = notification.is_read() ?
kNotificationReadColor : kNotificationColor;
content_view_.reset(new views::View);
content_view_->set_background(
« no previous file with comments | « ui/message_center/message_simple_view.h ('k') | ui/message_center/message_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698