From 839bc8027e57de37d22e893b0bd051361d0b0f2a Mon Sep 17 00:00:00 2001 From: "mukai@chromium.org" Date: Sat, 8 Jun 2013 17:39:43 +0000 Subject: Do not slide-up for the mouse click for the toast. BUG=247796 R=dewittj@chromium.org Review URL: https://chromiumcodereview.appspot.com/16675003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205078 0039d316-1c4b-4281-b951-d872f2087c98 --- .../views/message_popup_collection.cc | 44 +++++++++------------- 1 file changed, 18 insertions(+), 26 deletions(-) (limited to 'ui') diff --git a/ui/message_center/views/message_popup_collection.cc b/ui/message_center/views/message_popup_collection.cc index 869243c..4acafda 100644 --- a/ui/message_center/views/message_popup_collection.cc +++ b/ui/message_center/views/message_popup_collection.cc @@ -203,32 +203,24 @@ void MessagePopupCollection::RepositionWidgetsWithTarget() { if (toasts_.empty()) return; - if (toasts_.back()->origin().y() > target_top_edge_) { - // No widgets are above, thus slides up the widgets. - int slide_length = - toasts_.back()->origin().y() - target_top_edge_; - for (Toasts::iterator iter = toasts_.begin(); - iter != toasts_.end(); ++iter) { - gfx::Rect bounds((*iter)->bounds()); - bounds.set_y(bounds.y() - slide_length); - (*iter)->SetBoundsWithAnimation(bounds); - } - } else { - Toasts::reverse_iterator iter = toasts_.rbegin(); - for (; iter != toasts_.rend(); ++iter) { - if ((*iter)->origin().y() > target_top_edge_) - break; - } - --iter; - int slide_length = target_top_edge_ - (*iter)->origin().y(); - for (; ; --iter) { - gfx::Rect bounds((*iter)->bounds()); - bounds.set_y(bounds.y() + slide_length); - (*iter)->SetBoundsWithAnimation(bounds); - - if (iter == toasts_.rbegin()) - break; - } + // No widgets above. + if (toasts_.back()->origin().y() > target_top_edge_) + return; + + Toasts::reverse_iterator iter = toasts_.rbegin(); + for (; iter != toasts_.rend(); ++iter) { + if ((*iter)->origin().y() > target_top_edge_) + break; + } + --iter; + int slide_length = target_top_edge_ - (*iter)->origin().y(); + for (; ; --iter) { + gfx::Rect bounds((*iter)->bounds()); + bounds.set_y(bounds.y() + slide_length); + (*iter)->SetBoundsWithAnimation(bounds); + + if (iter == toasts_.rbegin()) + break; } } -- cgit v1.1