| 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/notification_view.h" |
| 10 #include "ui/notifications/notification_types.h" | 10 #include "ui/notifications/notification_types.h" |
| 11 #include "ui/views/bubble/tray_bubble_view.h" | 11 #include "ui/views/bubble/tray_bubble_view.h" |
| 12 #include "ui/views/layout/box_layout.h" | 12 #include "ui/views/layout/box_layout.h" |
| 13 #include "ui/views/view.h" | 13 #include "ui/views/view.h" |
| 14 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
| 15 | 15 |
| 16 namespace message_center { | 16 namespace message_center { |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 const int kAutocloseHighPriorityDelaySeconds = 25; | 19 const int kAutocloseHighPriorityDelaySeconds = 25; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 content_->SetFillsBoundsOpaquely(false); | 55 content_->SetFillsBoundsOpaquely(false); |
| 56 content_->layer()->SetMasksToBounds(true); | 56 content_->layer()->SetMasksToBounds(true); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void Update(const NotificationList::Notifications& popup_notifications) { | 59 void Update(const NotificationList::Notifications& popup_notifications) { |
| 60 content_->RemoveAllChildViews(true); | 60 content_->RemoveAllChildViews(true); |
| 61 for (NotificationList::Notifications::const_iterator iter = | 61 for (NotificationList::Notifications::const_iterator iter = |
| 62 popup_notifications.begin(); | 62 popup_notifications.begin(); |
| 63 iter != popup_notifications.end(); ++iter) { | 63 iter != popup_notifications.end(); ++iter) { |
| 64 MessageView* view = | 64 MessageView* view = |
| 65 MessageViewFactory::ViewForNotification(*iter, list_delegate_); | 65 NotificationView::ViewForNotification(*iter, list_delegate_); |
| 66 view->SetUpView(); | 66 view->SetUpView(); |
| 67 content_->AddChildView(view); | 67 content_->AddChildView(view); |
| 68 } | 68 } |
| 69 content_->SizeToPreferredSize(); | 69 content_->SizeToPreferredSize(); |
| 70 content_->InvalidateLayout(); | 70 content_->InvalidateLayout(); |
| 71 Layout(); | 71 Layout(); |
| 72 if (GetWidget()) | 72 if (GetWidget()) |
| 73 GetWidget()->GetRootView()->SchedulePaint(); | 73 GetWidget()->GetRootView()->SchedulePaint(); |
| 74 } | 74 } |
| 75 | 75 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 else | 194 else |
| 195 should_run_default_timer_ = false; | 195 should_run_default_timer_ = false; |
| 196 UpdateBubbleView(); | 196 UpdateBubbleView(); |
| 197 } | 197 } |
| 198 | 198 |
| 199 size_t MessagePopupBubble::NumMessageViewsForTest() const { | 199 size_t MessagePopupBubble::NumMessageViewsForTest() const { |
| 200 return contents_view_->NumMessageViews(); | 200 return contents_view_->NumMessageViews(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 } // namespace message_center | 203 } // namespace message_center |
| OLD | NEW |