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

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

Issue 14367021: Rename ClampToMin and ClampToMax (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 8 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
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 "grit/ui_strings.h" 9 #include "grit/ui_strings.h"
10 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 set_focus_border(NULL); 262 set_focus_border(NULL);
263 if (IsRichNotificationEnabled()) { 263 if (IsRichNotificationEnabled()) {
264 set_background(views::Background::CreateSolidBackground( 264 set_background(views::Background::CreateSolidBackground(
265 kMessageCenterBackgroundColor)); 265 kMessageCenterBackgroundColor));
266 SetVerticalScrollBar(new views::KennedyScrollBar(false)); 266 SetVerticalScrollBar(new views::KennedyScrollBar(false));
267 } 267 }
268 } 268 }
269 269
270 gfx::Size BoundedScrollView::GetPreferredSize() { 270 gfx::Size BoundedScrollView::GetPreferredSize() {
271 gfx::Size size = contents()->GetPreferredSize(); 271 gfx::Size size = contents()->GetPreferredSize();
272 size.ClampToMin(gfx::Size(size.width(), min_height_)); 272 size.ClampToLowerBound(gfx::Size(size.width(), min_height_));
273 size.ClampToMax(gfx::Size(size.width(), max_height_)); 273 size.ClampToUpperBound(gfx::Size(size.width(), max_height_));
274 gfx::Insets insets = GetInsets(); 274 gfx::Insets insets = GetInsets();
275 size.Enlarge(insets.width(), insets.height()); 275 size.Enlarge(insets.width(), insets.height());
276 return size; 276 return size;
277 } 277 }
278 278
279 int BoundedScrollView::GetHeightForWidth(int width) { 279 int BoundedScrollView::GetHeightForWidth(int width) {
280 gfx::Insets insets = GetInsets(); 280 gfx::Insets insets = GetInsets();
281 width = std::max(0, width - insets.width()); 281 width = std::max(0, width - insets.width());
282 int height = contents()->GetHeightForWidth(width) + insets.height(); 282 int height = contents()->GetHeightForWidth(width) + insets.height();
283 return std::min(std::max(height, min_height_), max_height_); 283 return std::min(std::max(height, min_height_), max_height_);
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 // NotificationViews are expanded by default here until 446 // NotificationViews are expanded by default here until
447 // http://crbug.com/217902 is fixed. TODO(dharcourt): Fix. 447 // http://crbug.com/217902 is fixed. TODO(dharcourt): Fix.
448 MessageView* view = NotificationView::Create( 448 MessageView* view = NotificationView::Create(
449 notification, message_center_, true); 449 notification, message_center_, true);
450 view->set_scroller(scroller_); 450 view->set_scroller(scroller_);
451 message_views_[notification.id()] = view; 451 message_views_[notification.id()] = view;
452 message_list_view_->AddChildView(view); 452 message_list_view_->AddChildView(view);
453 } 453 }
454 454
455 } // namespace message_center 455 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698