| 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_center_view.h" | 5 #include "ui/message_center/views/message_center_view.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 content_height += settings_view_->GetHeightForWidth(width); | 801 content_height += settings_view_->GetHeightForWidth(width); |
| 802 return button_bar_->GetHeightForWidth(width) + | 802 return button_bar_->GetHeightForWidth(width) + |
| 803 button_bar_->GetInsets().height() + content_height; | 803 button_bar_->GetInsets().height() + content_height; |
| 804 } | 804 } |
| 805 | 805 |
| 806 bool MessageCenterView::OnMouseWheel(const ui::MouseWheelEvent& event) { | 806 bool MessageCenterView::OnMouseWheel(const ui::MouseWheelEvent& event) { |
| 807 // Do not rely on the default scroll event handler of ScrollView because | 807 // Do not rely on the default scroll event handler of ScrollView because |
| 808 // the scroll happens only when the focus is on the ScrollView. The | 808 // the scroll happens only when the focus is on the ScrollView. The |
| 809 // notification center will allow the scrolling even when the focus is on | 809 // notification center will allow the scrolling even when the focus is on |
| 810 // the buttons. | 810 // the buttons. |
| 811 if (scroller_->bounds().Contains(event.location())) | 811 if (scroller_->bounds().Contains(gfx::ToFlooredPoint(event.location()))) |
| 812 return scroller_->OnMouseWheel(event); | 812 return scroller_->OnMouseWheel(event); |
| 813 return views::View::OnMouseWheel(event); | 813 return views::View::OnMouseWheel(event); |
| 814 } | 814 } |
| 815 | 815 |
| 816 void MessageCenterView::OnMouseExited(const ui::MouseEvent& event) { | 816 void MessageCenterView::OnMouseExited(const ui::MouseEvent& event) { |
| 817 if (is_closing_) | 817 if (is_closing_) |
| 818 return; | 818 return; |
| 819 | 819 |
| 820 message_list_view_->ResetRepositionSession(); | 820 message_list_view_->ResetRepositionSession(); |
| 821 NotificationsChanged(); | 821 NotificationsChanged(); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 scroller_->InvalidateLayout(); | 1002 scroller_->InvalidateLayout(); |
| 1003 PreferredSizeChanged(); | 1003 PreferredSizeChanged(); |
| 1004 Layout(); | 1004 Layout(); |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { | 1007 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { |
| 1008 message_list_view_->AddNotificationAt(view, 0); | 1008 message_list_view_->AddNotificationAt(view, 0); |
| 1009 } | 1009 } |
| 1010 | 1010 |
| 1011 } // namespace message_center | 1011 } // namespace message_center |
| OLD | NEW |