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

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

Issue 23764003: Make toasts notice when they're hidden and send the mouse-out event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a test. Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/message_center/views/message_popup_collection.h ('k') | ui/message_center/views/message_popup_collection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698