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

Unified Diff: ash/system/user/tray_user.cc

Issue 11535014: Replace StyleRange with BreakList; update RenderText, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update iteration and helpers; add tests; etc. Created 7 years, 11 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
Index: ash/system/user/tray_user.cc
diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc
index de5f7cbd7fc34f637a19ff3324f2cf2ad52c3c73..7950e9476c751247de31ce9ad9aca90e73983d11 100644
--- a/ash/system/user/tray_user.cc
+++ b/ash/system/user/tray_user.cc
@@ -272,10 +272,7 @@ void PublicAccountUserDetails::Layout() {
position.set_y(position.y() + size.height());
// Set the default text color for the line.
- gfx::StyleRange default_style(line->default_style());
- default_style.foreground = kPublicAccountUserCardTextColor;
- line->set_default_style(default_style);
- line->ApplyDefaultStyle();
+ line->SetColor(kPublicAccountUserCardTextColor);
// If a range of the line contains the user's display name, apply a custom
// text color to it.
@@ -284,11 +281,9 @@ void PublicAccountUserDetails::Layout() {
if (!display_name.is_empty()) {
display_name.set_end(
it->find(kDisplayNameMark, display_name.start() + 1));
- gfx::StyleRange display_name_style(line->default_style());
- display_name_style.foreground = kPublicAccountUserCardNameColor;
ui::Range line_range(0, it->size());
- display_name_style.range = display_name.Intersect(line_range);
- line->ApplyStyleRange(display_name_style);
+ line->ApplyColor(kPublicAccountUserCardNameColor,
+ display_name.Intersect(line_range));
Alexei Svitkine (slow) 2013/01/31 16:33:34 Nit: Align.
msw 2013/01/31 20:27:39 Done.
// Update the range for the next line.
if (display_name.end() >= line_range.end())
display_name.set_start(0);
« no previous file with comments | « no previous file | chrome/browser/ui/views/extensions/extension_installed_bubble.cc » ('j') | ui/gfx/render_text.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698