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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 toast->RevealWithAnimation(origin); | 165 toast->RevealWithAnimation(origin); |
166 | 166 |
167 // Shift the base line to be a few pixels above the last added toast or (few | 167 // Shift the base line to be a few pixels above the last added toast or (few |
168 // pixels below last added toast if top-aligned). | 168 // pixels below last added toast if top-aligned). |
169 if (top_down) | 169 if (top_down) |
170 base += view_height + kToastMarginY; | 170 base += view_height + kToastMarginY; |
171 else | 171 else |
172 base -= view_height + kToastMarginY; | 172 base -= view_height + kToastMarginY; |
173 | 173 |
174 if (views::ViewsDelegate::views_delegate) { | 174 if (views::ViewsDelegate::GetInstance()) { |
175 views::ViewsDelegate::views_delegate->NotifyAccessibilityEvent( | 175 views::ViewsDelegate::GetInstance()->NotifyAccessibilityEvent( |
176 toast, ui::AX_EVENT_ALERT); | 176 toast, ui::AX_EVENT_ALERT); |
177 } | 177 } |
178 | 178 |
179 message_center_->DisplayedNotification( | 179 message_center_->DisplayedNotification( |
180 (*iter)->id(), message_center::DISPLAY_SOURCE_POPUP); | 180 (*iter)->id(), message_center::DISPLAY_SOURCE_POPUP); |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 void MessagePopupCollection::OnMouseEntered(ToastContentsView* toast_entered) { | 184 void MessagePopupCollection::OnMouseEntered(ToastContentsView* toast_entered) { |
185 // Sometimes we can get two MouseEntered/MouseExited in a row when animating | 185 // Sometimes we can get two MouseEntered/MouseExited in a row when animating |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 views::Widget* widget = (*iter)->GetWidget(); | 500 views::Widget* widget = (*iter)->GetWidget(); |
501 if (widget) | 501 if (widget) |
502 return widget->GetWindowBoundsInScreen(); | 502 return widget->GetWindowBoundsInScreen(); |
503 break; | 503 break; |
504 } | 504 } |
505 } | 505 } |
506 return gfx::Rect(); | 506 return gfx::Rect(); |
507 } | 507 } |
508 | 508 |
509 } // namespace message_center | 509 } // namespace message_center |
OLD | NEW |