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/message_popup_bubble.h" | 5 #include "ui/message_center/message_popup_bubble.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "ui/message_center/message_view.h" | 8 #include "ui/message_center/message_view.h" |
9 #include "ui/message_center/message_view_factory.h" | 9 #include "ui/message_center/message_view_factory.h" |
10 #include "ui/notifications/notification_types.h" | 10 #include "ui/notifications/notification_types.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 explicit PopupBubbleContentsView(NotificationList::Delegate* list_delegate) | 44 explicit PopupBubbleContentsView(NotificationList::Delegate* list_delegate) |
45 : list_delegate_(list_delegate) { | 45 : list_delegate_(list_delegate) { |
46 SetLayoutManager( | 46 SetLayoutManager( |
47 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 1)); | 47 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 1)); |
48 | 48 |
49 content_ = new views::View; | 49 content_ = new views::View; |
50 content_->SetLayoutManager( | 50 content_->SetLayoutManager( |
51 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 1)); | 51 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 1)); |
52 AddChildView(content_); | 52 AddChildView(content_); |
53 | 53 |
| 54 #ifdef USE_AURA |
54 content_->SetPaintToLayer(true); | 55 content_->SetPaintToLayer(true); |
55 content_->SetFillsBoundsOpaquely(false); | 56 content_->SetFillsBoundsOpaquely(false); |
56 content_->layer()->SetMasksToBounds(true); | 57 content_->layer()->SetMasksToBounds(true); |
| 58 #endif // USE_AURA |
57 } | 59 } |
58 | 60 |
59 void Update(const NotificationList::Notifications& popup_notifications) { | 61 void Update(const NotificationList::Notifications& popup_notifications) { |
60 content_->RemoveAllChildViews(true); | 62 content_->RemoveAllChildViews(true); |
61 for (NotificationList::Notifications::const_iterator iter = | 63 for (NotificationList::Notifications::const_iterator iter = |
62 popup_notifications.begin(); | 64 popup_notifications.begin(); |
63 iter != popup_notifications.end(); ++iter) { | 65 iter != popup_notifications.end(); ++iter) { |
64 MessageView* view = | 66 MessageView* view = |
65 MessageViewFactory::ViewForNotification(*iter, list_delegate_); | 67 MessageViewFactory::ViewForNotification(*iter, list_delegate_); |
66 view->SetUpView(); | 68 view->SetUpView(); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 else | 196 else |
195 should_run_default_timer_ = false; | 197 should_run_default_timer_ = false; |
196 UpdateBubbleView(); | 198 UpdateBubbleView(); |
197 } | 199 } |
198 | 200 |
199 size_t MessagePopupBubble::NumMessageViewsForTest() const { | 201 size_t MessagePopupBubble::NumMessageViewsForTest() const { |
200 return contents_view_->NumMessageViews(); | 202 return contents_view_->NumMessageViews(); |
201 } | 203 } |
202 | 204 |
203 } // namespace message_center | 205 } // namespace message_center |
OLD | NEW |