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

Side by Side Diff: ui/message_center/views/custom_notification_view.cc

Issue 2066603003: No paint to layer for custom notification close button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698