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" |
11 #include "ui/accessibility/ax_view_state.h" | 11 #include "ui/accessibility/ax_view_state.h" |
| 12 #include "ui/base/cursor/cursor.h" |
12 #include "ui/events/event.h" | 13 #include "ui/events/event.h" |
13 #include "ui/events/keycodes/keyboard_codes.h" | 14 #include "ui/events/keycodes/keyboard_codes.h" |
14 #include "ui/gfx/canvas.h" | 15 #include "ui/gfx/canvas.h" |
15 #include "ui/gfx/color_utils.h" | 16 #include "ui/gfx/color_utils.h" |
16 #include "ui/gfx/font_list.h" | 17 #include "ui/gfx/font_list.h" |
17 #include "ui/views/controls/link_listener.h" | 18 #include "ui/views/controls/link_listener.h" |
18 | 19 |
19 #if defined(USE_AURA) | |
20 #include "ui/base/cursor/cursor.h" | |
21 #endif | |
22 | |
23 namespace views { | 20 namespace views { |
24 | 21 |
25 const char Link::kViewClassName[] = "Link"; | 22 const char Link::kViewClassName[] = "Link"; |
26 | 23 |
27 Link::Link() : Label(base::string16()) { | 24 Link::Link() : Label(base::string16()) { |
28 Init(); | 25 Init(); |
29 } | 26 } |
30 | 27 |
31 Link::Link(const base::string16& title) : Label(title) { | 28 Link::Link(const base::string16& title) : Label(title) { |
32 Init(); | 29 Init(); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 void Link::RecalculateFont() { | 224 void Link::RecalculateFont() { |
228 // Underline the link iff it is enabled and |underline_| is true. | 225 // Underline the link iff it is enabled and |underline_| is true. |
229 const int style = font_list().GetFontStyle(); | 226 const int style = font_list().GetFontStyle(); |
230 const int intended_style = (enabled() && underline_) ? | 227 const int intended_style = (enabled() && underline_) ? |
231 (style | gfx::Font::UNDERLINE) : (style & ~gfx::Font::UNDERLINE); | 228 (style | gfx::Font::UNDERLINE) : (style & ~gfx::Font::UNDERLINE); |
232 if (style != intended_style) | 229 if (style != intended_style) |
233 Label::SetFontList(font_list().DeriveWithStyle(intended_style)); | 230 Label::SetFontList(font_list().DeriveWithStyle(intended_style)); |
234 } | 231 } |
235 | 232 |
236 } // namespace views | 233 } // namespace views |
OLD | NEW |