| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/custom_notification_view.h" | 5 #include "ui/message_center/views/custom_notification_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/gfx/geometry/size.h" | 9 #include "ui/gfx/geometry/size.h" |
| 10 #include "ui/message_center/message_center_style.h" | 10 #include "ui/message_center/message_center_style.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 AddChildView(contents_view_); | 25 AddChildView(contents_view_); |
| 26 | 26 |
| 27 if (contents_view_->background()) { | 27 if (contents_view_->background()) { |
| 28 background_view()->background()->SetNativeControlColor( | 28 background_view()->background()->SetNativeControlColor( |
| 29 contents_view_->background()->get_color()); | 29 contents_view_->background()->get_color()); |
| 30 } | 30 } |
| 31 | 31 |
| 32 AddChildView(small_image()); | 32 AddChildView(small_image()); |
| 33 | 33 |
| 34 CreateOrUpdateCloseButtonView(notification); | 34 CreateOrUpdateCloseButtonView(notification); |
| 35 | |
| 36 // Use a layer for close button so that custom content does not eclipse it. | |
| 37 if (close_button()) | |
| 38 close_button()->SetPaintToLayer(true); | |
| 39 } | 35 } |
| 40 | 36 |
| 41 CustomNotificationView::~CustomNotificationView() {} | 37 CustomNotificationView::~CustomNotificationView() {} |
| 42 | 38 |
| 43 void CustomNotificationView::SetDrawBackgroundAsActive(bool active) { | 39 void CustomNotificationView::SetDrawBackgroundAsActive(bool active) { |
| 44 // Do nothing if |contents_view_| has a background. | 40 // Do nothing if |contents_view_| has a background. |
| 45 if (contents_view_->background()) | 41 if (contents_view_->background()) |
| 46 return; | 42 return; |
| 47 | 43 |
| 48 MessageView::SetDrawBackgroundAsActive(active); | 44 MessageView::SetDrawBackgroundAsActive(active); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 61 std::min(kMaxHeight, contents_height + insets.height()))); | 57 std::min(kMaxHeight, contents_height + insets.height()))); |
| 62 } | 58 } |
| 63 | 59 |
| 64 void CustomNotificationView::Layout() { | 60 void CustomNotificationView::Layout() { |
| 65 MessageView::Layout(); | 61 MessageView::Layout(); |
| 66 | 62 |
| 67 contents_view_->SetBoundsRect(GetContentsBounds()); | 63 contents_view_->SetBoundsRect(GetContentsBounds()); |
| 68 } | 64 } |
| 69 | 65 |
| 70 } // namespace message_center | 66 } // namespace message_center |
| OLD | NEW |