| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/controls/link.h" | 5 #include "views/controls/link.h" |
| 6 | 6 |
| 7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
| 8 #include <gdk/gdk.h> | 8 #include <gdk/gdk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| 11 #include "app/gfx/font.h" | |
| 12 #include "base/keyboard_codes.h" | 11 #include "base/keyboard_codes.h" |
| 13 #include "base/logging.h" | 12 #include "base/logging.h" |
| 14 #include "gfx/color_utils.h" | 13 #include "gfx/color_utils.h" |
| 14 #include "gfx/font.h" |
| 15 #include "views/event.h" | 15 #include "views/event.h" |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 void GetColors(const SkColor* background_color, // NULL means "use default" | 19 void GetColors(const SkColor* background_color, // NULL means "use default" |
| 20 SkColor* highlighted_color, | 20 SkColor* highlighted_color, |
| 21 SkColor* disabled_color, | 21 SkColor* disabled_color, |
| 22 SkColor* normal_color) { | 22 SkColor* normal_color) { |
| 23 static SkColor kHighlightedColor, kDisabledColor, kNormalColor; | 23 static SkColor kHighlightedColor, kDisabledColor, kNormalColor; |
| 24 static bool initialized = false; | 24 static bool initialized = false; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 Label::SetFont(font.DeriveFont(0, font.style() | gfx::Font::UNDERLINED)); | 224 Label::SetFont(font.DeriveFont(0, font.style() | gfx::Font::UNDERLINED)); |
| 225 Label::SetColor(highlighted_ ? highlighted_color_ : normal_color_); | 225 Label::SetColor(highlighted_ ? highlighted_color_ : normal_color_); |
| 226 } else { | 226 } else { |
| 227 if ((font.style() & gfx::Font::UNDERLINED) != 0) | 227 if ((font.style() & gfx::Font::UNDERLINED) != 0) |
| 228 Label::SetFont(font.DeriveFont(0, font.style() & ~gfx::Font::UNDERLINED)); | 228 Label::SetFont(font.DeriveFont(0, font.style() & ~gfx::Font::UNDERLINED)); |
| 229 Label::SetColor(disabled_color_); | 229 Label::SetColor(disabled_color_); |
| 230 } | 230 } |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace views | 233 } // namespace views |
| OLD | NEW |