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

Unified Diff: ui/message_center/views/message_popup_collection.cc

Issue 2472233002: Fix a bug of PopupAlignmentDelegate on non-primary display (Closed)
Patch Set: Addressed comment: returning a rect instead of top Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: ui/message_center/views/message_popup_collection.cc
diff --git a/ui/message_center/views/message_popup_collection.cc b/ui/message_center/views/message_popup_collection.cc
index 36ed61be7e005d6fb5851cd548ec5262516556cc..9b85920084f58ee808660e945bf1b87c9e4691b9 100644
--- a/ui/message_center/views/message_popup_collection.cc
+++ b/ui/message_center/views/message_popup_collection.cc
@@ -174,7 +174,8 @@ void MessagePopupCollection::UpdateWidgets() {
view->set_context_menu_controller(context_menu_controller_.get());
int view_height = ToastContentsView::GetToastSizeForView(view).height();
int height_available =
- top_down ? alignment_delegate_->GetWorkAreaBottom() - base : base;
+ top_down ? alignment_delegate_->GetWorkArea().bottom() - base
+ : base - alignment_delegate_->GetWorkArea().y();
if (height_available - view_height - kToastMarginY < 0) {
delete view;
@@ -295,8 +296,9 @@ void MessagePopupCollection::RepositionWidgets() {
// load and such notifications should disappear. Do not call
// CloseWithAnimation, we don't want to show the closing animation, and we
// don't want to mark such notifications as shown. See crbug.com/233424
- if ((top_down ? alignment_delegate_->GetWorkAreaBottom() - bounds.bottom()
- : bounds.y()) >= 0)
+ if ((top_down
+ ? alignment_delegate_->GetWorkArea().bottom() - bounds.bottom()
+ : bounds.y() - alignment_delegate_->GetWorkArea().y()) >= 0)
(*curr)->SetBoundsWithAnimation(bounds);
else
RemoveToast(*curr, /*mark_as_shown=*/false);
« no previous file with comments | « ui/message_center/views/desktop_popup_alignment_delegate.cc ('k') | ui/message_center/views/popup_alignment_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698