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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 MessagePopupCollection::~MessagePopupCollection() { | 94 MessagePopupCollection::~MessagePopupCollection() { |
95 gfx::Screen* screen = parent_ ? | 95 gfx::Screen* screen = parent_ ? |
96 gfx::Screen::GetScreenFor(parent_) : gfx::Screen::GetNativeScreen(); | 96 gfx::Screen::GetScreenFor(parent_) : gfx::Screen::GetNativeScreen(); |
97 screen->RemoveObserver(this); | 97 screen->RemoveObserver(this); |
98 message_center_->RemoveObserver(this); | 98 message_center_->RemoveObserver(this); |
99 CloseAllWidgets(); | 99 CloseAllWidgets(); |
100 } | 100 } |
101 | 101 |
102 void MessagePopupCollection::RemoveToast(ToastContentsView* toast) { | 102 void MessagePopupCollection::RemoveToast(ToastContentsView* toast) { |
| 103 OnMouseExited(toast); |
| 104 |
103 for (Toasts::iterator iter = toasts_.begin(); iter != toasts_.end(); ++iter) { | 105 for (Toasts::iterator iter = toasts_.begin(); iter != toasts_.end(); ++iter) { |
104 if ((*iter) == toast) { | 106 if ((*iter) == toast) { |
105 toasts_.erase(iter); | 107 toasts_.erase(iter); |
106 break; | 108 break; |
107 } | 109 } |
108 } | 110 } |
109 } | 111 } |
110 | 112 |
111 void MessagePopupCollection::UpdateWidgets() { | 113 void MessagePopupCollection::UpdateWidgets() { |
112 NotificationList::PopupNotifications popups = | 114 NotificationList::PopupNotifications popups = |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 views::Widget* widget = (*iter)->GetWidget(); | 517 views::Widget* widget = (*iter)->GetWidget(); |
516 if (widget) | 518 if (widget) |
517 return widget->GetWindowBoundsInScreen(); | 519 return widget->GetWindowBoundsInScreen(); |
518 break; | 520 break; |
519 } | 521 } |
520 } | 522 } |
521 return gfx::Rect(); | 523 return gfx::Rect(); |
522 } | 524 } |
523 | 525 |
524 } // namespace message_center | 526 } // namespace message_center |
OLD | NEW |