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 <map> | 7 #include <map> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "ui/message_center/views/message_view.h" | 24 #include "ui/message_center/views/message_view.h" |
25 #include "ui/message_center/views/notification_view.h" | 25 #include "ui/message_center/views/notification_view.h" |
26 #include "ui/views/animation/bounds_animator.h" | 26 #include "ui/views/animation/bounds_animator.h" |
27 #include "ui/views/animation/bounds_animator_observer.h" | 27 #include "ui/views/animation/bounds_animator_observer.h" |
28 #include "ui/views/background.h" | 28 #include "ui/views/background.h" |
29 #include "ui/views/border.h" | 29 #include "ui/views/border.h" |
30 #include "ui/views/controls/button/button.h" | 30 #include "ui/views/controls/button/button.h" |
31 #include "ui/views/controls/button/label_button.h" | 31 #include "ui/views/controls/button/label_button.h" |
32 #include "ui/views/controls/label.h" | 32 #include "ui/views/controls/label.h" |
33 #include "ui/views/controls/scroll_view.h" | 33 #include "ui/views/controls/scroll_view.h" |
34 #include "ui/views/controls/scrollbar/kennedy_scroll_bar.h" | 34 #include "ui/views/controls/scrollbar/overlay_scroll_bar.h" |
35 #include "ui/views/layout/box_layout.h" | 35 #include "ui/views/layout/box_layout.h" |
36 #include "ui/views/layout/grid_layout.h" | 36 #include "ui/views/layout/grid_layout.h" |
37 #include "ui/views/painter.h" | 37 #include "ui/views/painter.h" |
38 #include "ui/views/widget/widget.h" | 38 #include "ui/views/widget/widget.h" |
39 | 39 |
40 namespace message_center { | 40 namespace message_center { |
41 | 41 |
42 namespace { | 42 namespace { |
43 | 43 |
44 const int kMinScrollViewHeight = 100; | 44 const int kMinScrollViewHeight = 100; |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 | 299 |
300 BoundedScrollView::BoundedScrollView(int min_height, int max_height) | 300 BoundedScrollView::BoundedScrollView(int min_height, int max_height) |
301 : min_height_(min_height), | 301 : min_height_(min_height), |
302 max_height_(max_height) { | 302 max_height_(max_height) { |
303 set_notify_enter_exit_on_child(true); | 303 set_notify_enter_exit_on_child(true); |
304 // Cancels the default dashed focus border. | 304 // Cancels the default dashed focus border. |
305 set_focus_border(NULL); | 305 set_focus_border(NULL); |
306 if (IsRichNotificationEnabled()) { | 306 if (IsRichNotificationEnabled()) { |
307 set_background(views::Background::CreateSolidBackground( | 307 set_background(views::Background::CreateSolidBackground( |
308 kMessageCenterBackgroundColor)); | 308 kMessageCenterBackgroundColor)); |
309 SetVerticalScrollBar(new views::KennedyScrollBar(false)); | 309 SetVerticalScrollBar(new views::OverlayScrollBar(false)); |
310 } | 310 } |
311 } | 311 } |
312 | 312 |
313 gfx::Size BoundedScrollView::GetPreferredSize() { | 313 gfx::Size BoundedScrollView::GetPreferredSize() { |
314 gfx::Size size = contents()->GetPreferredSize(); | 314 gfx::Size size = contents()->GetPreferredSize(); |
315 size.SetToMax(gfx::Size(size.width(), min_height_)); | 315 size.SetToMax(gfx::Size(size.width(), min_height_)); |
316 size.SetToMin(gfx::Size(size.width(), max_height_)); | 316 size.SetToMin(gfx::Size(size.width(), max_height_)); |
317 gfx::Insets insets = GetInsets(); | 317 gfx::Insets insets = GetInsets(); |
318 size.Enlarge(insets.width(), insets.height()); | 318 size.Enlarge(insets.width(), insets.height()); |
319 return size; | 319 return size; |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 scroller_->InvalidateLayout(); | 918 scroller_->InvalidateLayout(); |
919 PreferredSizeChanged(); | 919 PreferredSizeChanged(); |
920 Layout(); | 920 Layout(); |
921 } | 921 } |
922 | 922 |
923 void MessageCenterView::SetNotificationViewForTest(views::View* view) { | 923 void MessageCenterView::SetNotificationViewForTest(views::View* view) { |
924 message_list_view_->AddNotificationAt(view, 0); | 924 message_list_view_->AddNotificationAt(view, 0); |
925 } | 925 } |
926 | 926 |
927 } // namespace message_center | 927 } // namespace message_center |
OLD | NEW |