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

Unified Diff: ui/views/controls/link.cc

Issue 17756003: Colors in views::StyledLabel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename SetBackgroundColor -> SetDisplayedOnBackgroundColor Created 7 years, 5 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/views/controls/link.h ('k') | ui/views/controls/styled_label.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/link.cc
diff --git a/ui/views/controls/link.cc b/ui/views/controls/link.cc
index fcb73f10f1cbdd9066b94bfcb3b6b871d7efcb95..f6c298c6f1df1257d1291920e2e69101cda923d3 100644
--- a/ui/views/controls/link.cc
+++ b/ui/views/controls/link.cc
@@ -34,6 +34,14 @@ Link::Link(const string16& title) : Label(title) {
Link::~Link() {
}
+SkColor Link::GetDefaultEnabledColor() {
+#if defined(OS_WIN)
+ return color_utils::GetSysSkColor(COLOR_HOTLIGHT);
Evan Stade 2013/07/11 17:54:39 I dont' know if this is an expensive operation, bu
fdoray 2013/07/11 19:56:26 It makes a call to a Windows function (GetSysColor
+#else
+ return SkColorSetRGB(0, 51, 153);
+#endif
+}
+
void Link::OnEnabledChanged() {
RecalculateFont();
View::OnEnabledChanged();
@@ -165,17 +173,15 @@ void Link::SetUnderline(bool underline) {
void Link::Init() {
static bool initialized = false;
- static SkColor kDefaultEnabledColor;
+ static SkColor kDefaultEnabledColor = GetDefaultEnabledColor();
static SkColor kDefaultDisabledColor;
static SkColor kDefaultPressedColor;
if (!initialized) {
#if defined(OS_WIN)
- kDefaultEnabledColor = color_utils::GetSysSkColor(COLOR_HOTLIGHT);
kDefaultDisabledColor = color_utils::GetSysSkColor(COLOR_WINDOWTEXT);
kDefaultPressedColor = SkColorSetRGB(200, 0, 0);
#else
// TODO(beng): source from theme provider.
- kDefaultEnabledColor = SkColorSetRGB(0, 51, 153);
kDefaultDisabledColor = SK_ColorBLACK;
kDefaultPressedColor = SK_ColorRED;
#endif
« no previous file with comments | « ui/views/controls/link.h ('k') | ui/views/controls/styled_label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698