| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/message_center/views/message_view.h" | 5 #include "ui/message_center/views/message_view.h" |
| 6 | 6 |
| 7 #include "grit/ui_resources.h" | 7 #include "grit/ui_resources.h" |
| 8 #include "grit/ui_strings.h" | 8 #include "grit/ui_strings.h" |
| 9 #include "ui/accessibility/ax_view_state.h" | 9 #include "ui/accessibility/ax_view_state.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 close_button_.reset(close); | 76 close_button_.reset(close); |
| 77 | 77 |
| 78 focus_painter_ = views::Painter::CreateSolidFocusPainter( | 78 focus_painter_ = views::Painter::CreateSolidFocusPainter( |
| 79 kFocusBorderColor, | 79 kFocusBorderColor, |
| 80 gfx::Insets(0, 1, 3, 2)).Pass(); | 80 gfx::Insets(0, 1, 3, 2)).Pass(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 MessageView::~MessageView() { | 83 MessageView::~MessageView() { |
| 84 } | 84 } |
| 85 | 85 |
| 86 void MessageView::UpdateWithNotification(const Notification& notification) { |
| 87 small_image_view_->SetImage(notification.small_image().AsImageSkia()); |
| 88 display_source_ = notification.display_source(); |
| 89 } |
| 90 |
| 86 // static | 91 // static |
| 87 gfx::Insets MessageView::GetShadowInsets() { | 92 gfx::Insets MessageView::GetShadowInsets() { |
| 88 return gfx::Insets(kShadowBlur / 2 - kShadowOffset, | 93 return gfx::Insets(kShadowBlur / 2 - kShadowOffset, |
| 89 kShadowBlur / 2, | 94 kShadowBlur / 2, |
| 90 kShadowBlur / 2 + kShadowOffset, | 95 kShadowBlur / 2 + kShadowOffset, |
| 91 kShadowBlur / 2); | 96 kShadowBlur / 2); |
| 92 } | 97 } |
| 93 | 98 |
| 94 void MessageView::CreateShadowBorder() { | 99 void MessageView::CreateShadowBorder() { |
| 95 SetBorder(scoped_ptr<views::Border>( | 100 SetBorder(scoped_ptr<views::Border>( |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 if (sender == close_button()) { | 219 if (sender == close_button()) { |
| 215 controller_->RemoveNotification(notification_id_, true); // By user. | 220 controller_->RemoveNotification(notification_id_, true); // By user. |
| 216 } | 221 } |
| 217 } | 222 } |
| 218 | 223 |
| 219 void MessageView::OnSlideOut() { | 224 void MessageView::OnSlideOut() { |
| 220 controller_->RemoveNotification(notification_id_, true); // By user. | 225 controller_->RemoveNotification(notification_id_, true); // By user. |
| 221 } | 226 } |
| 222 | 227 |
| 223 } // namespace message_center | 228 } // namespace message_center |
| OLD | NEW |