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

Unified Diff: views/view_text_utils.cc

Issue 8221027: Make views::Label and views::Link auto-color themselves to be readable over their background colo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 2 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
« views/controls/link.cc ('K') | « views/controls/link.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/view_text_utils.cc
===================================================================
--- views/view_text_utils.cc (revision 104769)
+++ views/view_text_utils.cc (working copy)
@@ -9,7 +9,6 @@
#include "base/logging.h"
#include "base/utf_string_conversions.h"
#include "ui/gfx/canvas_skia.h"
-#include "ui/gfx/color_utils.h"
#include "ui/gfx/size.h"
#include "views/controls/label.h"
#include "views/controls/link.h"
@@ -88,13 +87,6 @@
const gfx::Font& font,
bool text_direction_is_rtl,
bool ltr_within_rtl) {
-#if defined(OS_WIN)
- const SkColor text_color = color_utils::GetSysSkColor(COLOR_WINDOWTEXT);
-#else
- // TODO(beng): source from theme provider.
- const SkColor text_color = SK_ColorBLACK;
-#endif
-
// Iterate through line breaking opportunities (which in English would be
// spaces and such). This tells us where to wrap.
string16 text16(WideToUTF16(text));
@@ -140,8 +132,8 @@
int y = position->height() + bounds.y();
// Draw the text on the screen (mirrored, if RTL run).
- canvas->DrawStringInt(word, font, text_color, x, y, w, font.GetHeight(),
- flags);
+ canvas->DrawStringInt(word, font, label->enabled_color(), x, y, w,
+ font.GetHeight(), flags);
if (!word.empty() && word[word.size() - 1] == '\x0a') {
// When we come across '\n', we move to the beginning of the next line.
« views/controls/link.cc ('K') | « views/controls/link.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698