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

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

Issue 152733002: Clean-up: Replaces obsolete Font/FontList methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced. Created 6 years, 10 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 | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/notification_view.h" 5 #include "ui/message_center/views/notification_view.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "grit/ui_resources.h" 10 #include "grit/ui_resources.h"
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); 319 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
320 top_view_->SetBorder( 320 top_view_->SetBorder(
321 MakeEmptyBorder(kTextTopPadding - 8, 0, kTextBottomPadding - 5, 0)); 321 MakeEmptyBorder(kTextTopPadding - 8, 0, kTextBottomPadding - 5, 0));
322 322
323 const gfx::FontList default_label_font_list = views::Label().font_list(); 323 const gfx::FontList default_label_font_list = views::Label().font_list();
324 324
325 // Create the title view if appropriate. 325 // Create the title view if appropriate.
326 title_view_ = NULL; 326 title_view_ = NULL;
327 if (!notification.title().empty()) { 327 if (!notification.title().empty()) {
328 const gfx::FontList& font_list = 328 const gfx::FontList& font_list =
329 default_label_font_list.DeriveFontListWithSizeDelta(2); 329 default_label_font_list.DeriveWithSizeDelta(2);
330 int padding = kTitleLineHeight - font_list.GetHeight(); 330 int padding = kTitleLineHeight - font_list.GetHeight();
331 title_view_ = new BoundedLabel( 331 title_view_ = new BoundedLabel(
332 gfx::TruncateString(notification.title(), kTitleCharacterLimit), 332 gfx::TruncateString(notification.title(), kTitleCharacterLimit),
333 font_list); 333 font_list);
334 title_view_->SetLineHeight(kTitleLineHeight); 334 title_view_->SetLineHeight(kTitleLineHeight);
335 title_view_->SetLineLimit(IsExperimentalNotificationUIEnabled() ? 335 title_view_->SetLineLimit(IsExperimentalNotificationUIEnabled() ?
336 message_center::kExperimentalTitleLineLimit : 336 message_center::kExperimentalTitleLineLimit :
337 message_center::kTitleLineLimit); 337 message_center::kTitleLineLimit);
338 title_view_->SetColors(message_center::kRegularTextColor, 338 title_view_->SetColors(message_center::kRegularTextColor,
339 kRegularTextBackgroundColor); 339 kRegularTextBackgroundColor);
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 return message_view_ ? 668 return message_view_ ?
669 message_view_->GetLinesForWidthAndLimit(width, limit) : 0; 669 message_view_->GetLinesForWidthAndLimit(width, limit) : 0;
670 } 670 }
671 671
672 int NotificationView::GetMessageHeight(int width, int limit) { 672 int NotificationView::GetMessageHeight(int width, int limit) {
673 return message_view_ ? 673 return message_view_ ?
674 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; 674 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0;
675 } 675 }
676 676
677 } // namespace message_center 677 } // namespace message_center
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698