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

Side by Side Diff: ui/message_center/views/message_center_view.cc

Issue 16171010: Introduces a new scrollbar for message_center. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GetVisibleSize -> GetContentOverlapSize Created 7 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/message_center/views/notifier_settings_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 297
298 BoundedScrollView::BoundedScrollView(int min_height, int max_height) 298 BoundedScrollView::BoundedScrollView(int min_height, int max_height)
299 : min_height_(min_height), 299 : min_height_(min_height),
300 max_height_(max_height) { 300 max_height_(max_height) {
301 set_notify_enter_exit_on_child(true); 301 set_notify_enter_exit_on_child(true);
302 // Cancels the default dashed focus border. 302 // Cancels the default dashed focus border.
303 set_focus_border(NULL); 303 set_focus_border(NULL);
304 if (IsRichNotificationEnabled()) { 304 if (IsRichNotificationEnabled()) {
305 set_background(views::Background::CreateSolidBackground( 305 set_background(views::Background::CreateSolidBackground(
306 kMessageCenterBackgroundColor)); 306 kMessageCenterBackgroundColor));
307 SetVerticalScrollBar(new views::KennedyScrollBar(false)); 307 SetVerticalScrollBar(new views::OverlayScrollBar(false));
308 } 308 }
309 } 309 }
310 310
311 gfx::Size BoundedScrollView::GetPreferredSize() { 311 gfx::Size BoundedScrollView::GetPreferredSize() {
312 gfx::Size size = contents()->GetPreferredSize(); 312 gfx::Size size = contents()->GetPreferredSize();
313 size.SetToMax(gfx::Size(size.width(), min_height_)); 313 size.SetToMax(gfx::Size(size.width(), min_height_));
314 size.SetToMin(gfx::Size(size.width(), max_height_)); 314 size.SetToMin(gfx::Size(size.width(), max_height_));
315 gfx::Insets insets = GetInsets(); 315 gfx::Insets insets = GetInsets();
316 size.Enlarge(insets.width(), insets.height()); 316 size.Enlarge(insets.width(), insets.height());
317 return size; 317 return size;
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 scroller_->InvalidateLayout(); 916 scroller_->InvalidateLayout();
917 PreferredSizeChanged(); 917 PreferredSizeChanged();
918 Layout(); 918 Layout();
919 } 919 }
920 920
921 void MessageCenterView::SetNotificationViewForTest(views::View* view) { 921 void MessageCenterView::SetNotificationViewForTest(views::View* view) {
922 message_list_view_->AddNotificationAt(view, 0); 922 message_list_view_->AddNotificationAt(view, 0);
923 } 923 }
924 924
925 } // namespace message_center 925 } // namespace message_center
OLDNEW
« no previous file with comments | « no previous file | ui/message_center/views/notifier_settings_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698