| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_popup_collection.h" | 5 #include "ui/message_center/views/message_popup_collection.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 bool top_down = alignment_delegate_->IsTopDown(); | 149 bool top_down = alignment_delegate_->IsTopDown(); |
| 150 int base = GetBaseLine(toasts_.empty() ? NULL : toasts_.back()); | 150 int base = GetBaseLine(toasts_.empty() ? NULL : toasts_.back()); |
| 151 | 151 |
| 152 // Iterate in the reverse order to keep the oldest toasts on screen. Newer | 152 // Iterate in the reverse order to keep the oldest toasts on screen. Newer |
| 153 // items may be ignored if there are no room to place them. | 153 // items may be ignored if there are no room to place them. |
| 154 for (NotificationList::PopupNotifications::const_reverse_iterator iter = | 154 for (NotificationList::PopupNotifications::const_reverse_iterator iter = |
| 155 popups.rbegin(); iter != popups.rend(); ++iter) { | 155 popups.rbegin(); iter != popups.rend(); ++iter) { |
| 156 if (FindToast((*iter)->id())) | 156 if (FindToast((*iter)->id())) |
| 157 continue; | 157 continue; |
| 158 | 158 |
| 159 NotificationView* view; | 159 MessageView* view; |
| 160 // Create top-level notification. | 160 // Create top-level notification. |
| 161 #if defined(OS_CHROMEOS) | 161 #if defined(OS_CHROMEOS) |
| 162 if ((*iter)->pinned()) { | 162 if ((*iter)->pinned()) { |
| 163 Notification notification = *(*iter); | 163 Notification notification = *(*iter); |
| 164 // Override pinned status, since toasts should be closable even when it's | 164 // Override pinned status, since toasts should be closable even when it's |
| 165 // pinned. | 165 // pinned. |
| 166 notification.set_pinned(false); | 166 notification.set_pinned(false); |
| 167 view = NotificationView::Create(NULL, notification, true); | 167 view = NotificationView::Create(NULL, notification, true); |
| 168 } else | 168 } else |
| 169 #endif // defined(OS_CHROMEOS) | 169 #endif // defined(OS_CHROMEOS) |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 views::Widget* widget = (*iter)->GetWidget(); | 537 views::Widget* widget = (*iter)->GetWidget(); |
| 538 if (widget) | 538 if (widget) |
| 539 return widget->GetWindowBoundsInScreen(); | 539 return widget->GetWindowBoundsInScreen(); |
| 540 break; | 540 break; |
| 541 } | 541 } |
| 542 } | 542 } |
| 543 return gfx::Rect(); | 543 return gfx::Rect(); |
| 544 } | 544 } |
| 545 | 545 |
| 546 } // namespace message_center | 546 } // namespace message_center |
| OLD | NEW |