| OLD | NEW |
| 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/views/controls/link.h" | 5 #include "ui/views/controls/link.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 Label::SetFontList(font_list); | 160 Label::SetFontList(font_list); |
| 161 RecalculateFont(); | 161 RecalculateFont(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 void Link::SetText(const base::string16& text) { | 164 void Link::SetText(const base::string16& text) { |
| 165 Label::SetText(text); | 165 Label::SetText(text); |
| 166 ConfigureFocus(); | 166 ConfigureFocus(); |
| 167 } | 167 } |
| 168 | 168 |
| 169 void Link::OnNativeThemeChanged(const ui::NativeTheme* theme) { | 169 void Link::OnNativeThemeChanged(const ui::NativeTheme* theme) { |
| 170 Label::OnNativeThemeChanged(theme); |
| 170 Label::SetEnabledColor(GetEnabledColor()); | 171 Label::SetEnabledColor(GetEnabledColor()); |
| 171 SetDisabledColor( | 172 SetDisabledColor( |
| 172 theme->GetSystemColor(ui::NativeTheme::kColorId_LinkDisabled)); | 173 theme->GetSystemColor(ui::NativeTheme::kColorId_LinkDisabled)); |
| 173 } | 174 } |
| 174 | 175 |
| 175 void Link::SetEnabledColor(SkColor color) { | 176 void Link::SetEnabledColor(SkColor color) { |
| 176 requested_enabled_color_set_ = true; | 177 requested_enabled_color_set_ = true; |
| 177 requested_enabled_color_ = color; | 178 requested_enabled_color_ = color; |
| 178 Label::SetEnabledColor(GetEnabledColor()); | 179 Label::SetEnabledColor(GetEnabledColor()); |
| 179 } | 180 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 if (GetNativeTheme()) { | 248 if (GetNativeTheme()) { |
| 248 return GetNativeTheme()->GetSystemColor( | 249 return GetNativeTheme()->GetSystemColor( |
| 249 pressed_ ? ui::NativeTheme::kColorId_LinkPressed | 250 pressed_ ? ui::NativeTheme::kColorId_LinkPressed |
| 250 : ui::NativeTheme::kColorId_LinkEnabled); | 251 : ui::NativeTheme::kColorId_LinkEnabled); |
| 251 } | 252 } |
| 252 | 253 |
| 253 return gfx::kPlaceholderColor; | 254 return gfx::kPlaceholderColor; |
| 254 } | 255 } |
| 255 | 256 |
| 256 } // namespace views | 257 } // namespace views |
| OLD | NEW |