| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(TOOLKIT_USES_GTK) | 9 #if defined(TOOLKIT_USES_GTK) |
| 10 #include <gdk/gdk.h> | 10 #include <gdk/gdk.h> |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "ui/base/accessibility/accessible_view_state.h" | 15 #include "ui/base/accessibility/accessible_view_state.h" |
| 16 #include "ui/base/keycodes/keyboard_codes.h" | 16 #include "ui/base/keycodes/keyboard_codes.h" |
| 17 #include "ui/gfx/color_utils.h" | 17 #include "ui/gfx/color_utils.h" |
| 18 #include "ui/gfx/font.h" | 18 #include "ui/gfx/font.h" |
| 19 #include "ui/views/events/event.h" |
| 19 #include "views/controls/link_listener.h" | 20 #include "views/controls/link_listener.h" |
| 20 #include "views/events/event.h" | |
| 21 | 21 |
| 22 #if defined(TOOLKIT_USES_GTK) | 22 #if defined(TOOLKIT_USES_GTK) |
| 23 #include "ui/gfx/gtk_util.h" | 23 #include "ui/gfx/gtk_util.h" |
| 24 #endif | 24 #endif |
| 25 | 25 |
| 26 #if defined(USE_AURA) | 26 #if defined(USE_AURA) |
| 27 #include "ui/aura/cursor.h" | 27 #include "ui/aura/cursor.h" |
| 28 #endif | 28 #endif |
| 29 | 29 |
| 30 namespace views { | 30 namespace views { |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 void Link::RecalculateFont() { | 191 void Link::RecalculateFont() { |
| 192 // The font should be underlined iff the link is enabled. | 192 // The font should be underlined iff the link is enabled. |
| 193 if (IsEnabled() == !(font().GetStyle() & gfx::Font::UNDERLINED)) { | 193 if (IsEnabled() == !(font().GetStyle() & gfx::Font::UNDERLINED)) { |
| 194 Label::SetFont(font().DeriveFont(0, IsEnabled() ? | 194 Label::SetFont(font().DeriveFont(0, IsEnabled() ? |
| 195 (font().GetStyle() | gfx::Font::UNDERLINED) : | 195 (font().GetStyle() | gfx::Font::UNDERLINED) : |
| 196 (font().GetStyle() & ~gfx::Font::UNDERLINED))); | 196 (font().GetStyle() & ~gfx::Font::UNDERLINED))); |
| 197 } | 197 } |
| 198 } | 198 } |
| 199 | 199 |
| 200 } // namespace views | 200 } // namespace views |
| OLD | NEW |