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

Unified Diff: ui/message_center/views/notification_view.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/message_center/views/notification_view.h ('k') | ui/message_center/views/notifier_settings_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/notification_view.cc
diff --git a/ui/message_center/views/notification_view.cc b/ui/message_center/views/notification_view.cc
index 0884205e68f3077fa66d02e31638a5e3f820d205..5a404436b9ef4561e20d640f33bc2cc0649eb4c6 100644
--- a/ui/message_center/views/notification_view.cc
+++ b/ui/message_center/views/notification_view.cc
@@ -197,7 +197,7 @@ class NotificationProgressBar : public views::ProgressBar {
private:
// Overriden from View
- virtual gfx::Size GetPreferredSize() OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const OVERRIDE;
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(NotificationProgressBar);
@@ -209,7 +209,7 @@ NotificationProgressBar::NotificationProgressBar() {
NotificationProgressBar::~NotificationProgressBar() {
}
-gfx::Size NotificationProgressBar::GetPreferredSize() {
+gfx::Size NotificationProgressBar::GetPreferredSize() const {
gfx::Size pref_size(kProgressBarWidth, message_center::kProgressBarThickness);
gfx::Insets insets = GetInsets();
pref_size.Enlarge(insets.width(), insets.height());
@@ -362,7 +362,7 @@ NotificationView::NotificationView(MessageCenterController* controller,
NotificationView::~NotificationView() {
}
-gfx::Size NotificationView::GetPreferredSize() {
+gfx::Size NotificationView::GetPreferredSize() const {
int top_width = top_view_->GetPreferredSize().width() +
icon_view_->GetPreferredSize().width();
int bottom_width = bottom_view_->GetPreferredSize().width();
@@ -370,7 +370,7 @@ gfx::Size NotificationView::GetPreferredSize() {
return gfx::Size(preferred_width, GetHeightForWidth(preferred_width));
}
-int NotificationView::GetHeightForWidth(int width) {
+int NotificationView::GetHeightForWidth(int width) const {
// Get the height assuming no line limit changes.
int content_width = width - GetInsets().width();
int top_height = top_view_->GetHeightForWidth(content_width);
@@ -728,7 +728,7 @@ void NotificationView::CreateOrUpdateActionButtonViews(
}
}
-int NotificationView::GetMessageLineLimit(int title_lines, int width) {
+int NotificationView::GetMessageLineLimit(int title_lines, int width) const {
// Image notifications require that the image must be kept flush against
// their icons, but we can allow more text if no image.
int effective_title_lines = std::max(0, title_lines - 1);
@@ -764,7 +764,7 @@ int NotificationView::GetMessageLineLimit(int title_lines, int width) {
return message_line_limit;
}
-int NotificationView::GetMessageHeight(int width, int limit) {
+int NotificationView::GetMessageHeight(int width, int limit) const {
return message_view_ ?
message_view_->GetSizeForWidthAndLines(width, limit).height() : 0;
}
« no previous file with comments | « ui/message_center/views/notification_view.h ('k') | ui/message_center/views/notifier_settings_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698