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

Unified Diff: ui/message_center/views/message_view.cc

Issue 2620133003: Set slide_out_enabled property for CustomNotification (Closed)
Patch Set: Fix the wrong term: vertical -> horizontal Created 3 years, 11 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/views/message_view.cc
diff --git a/ui/message_center/views/message_view.cc b/ui/message_center/views/message_view.cc
index 4ec351c79b7304f9c2525b0898f8292ff9be987a..d4fb66ceba7f084b351d8fa7a8eee8b231f36f18 100644
--- a/ui/message_center/views/message_view.cc
+++ b/ui/message_center/views/message_view.cc
@@ -64,8 +64,7 @@ MessageView::MessageView(MessageCenterController* controller,
const Notification& notification)
: controller_(controller),
notification_id_(notification.id()),
- notifier_id_(notification.notifier_id()),
- display_source_(notification.display_source()) {
+ notifier_id_(notification.notifier_id()) {
SetFocusBehavior(FocusBehavior::ALWAYS);
// Create the opaque background that's above the view's shadow.
@@ -75,7 +74,6 @@ MessageView::MessageView(MessageCenterController* controller,
AddChildView(background_view_);
views::ImageView* small_image_view = new views::ImageView();
- small_image_view->SetImage(notification.small_image().AsImageSkia());
small_image_view->SetImageSize(gfx::Size(kSmallImageSize, kSmallImageSize));
// The small image view should be added to view hierarchy by the derived
// class. This ensures that it is on top of other views.
@@ -85,7 +83,7 @@ MessageView::MessageView(MessageCenterController* controller,
focus_painter_ = views::Painter::CreateSolidFocusPainter(
kFocusBorderColor, gfx::Insets(0, 1, 3, 2));
- accessible_name_ = CreateAccessibleName(notification);
+ UpdateWithNotification(notification);
}
MessageView::~MessageView() {
@@ -95,6 +93,7 @@ void MessageView::UpdateWithNotification(const Notification& notification) {
small_image_view_->SetImage(notification.small_image().AsImageSkia());
display_source_ = notification.display_source();
accessible_name_ = CreateAccessibleName(notification);
+ set_slide_out_enabled(!notification.pinned());
}
// static
« no previous file with comments | « ui/message_center/views/custom_notification_view_unittest.cc ('k') | ui/message_center/views/notification_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698