| 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_node_data.h" |
| 12 #include "ui/base/cursor/cursor.h" | 12 #include "ui/base/cursor/cursor.h" |
| 13 #include "ui/base/material_design/material_design_controller.h" | 13 #include "ui/base/material_design/material_design_controller.h" |
| 14 #include "ui/events/event.h" | 14 #include "ui/events/event.h" |
| 15 #include "ui/events/keycodes/keyboard_codes.h" | 15 #include "ui/events/keycodes/keyboard_codes.h" |
| 16 #include "ui/gfx/canvas.h" | 16 #include "ui/gfx/canvas.h" |
| 17 #include "ui/gfx/color_palette.h" | 17 #include "ui/gfx/color_palette.h" |
| 18 #include "ui/gfx/color_utils.h" | 18 #include "ui/gfx/color_utils.h" |
| 19 #include "ui/gfx/font_list.h" | 19 #include "ui/gfx/font_list.h" |
| 20 #include "ui/native_theme/native_theme.h" | 20 #include "ui/native_theme/native_theme.h" |
| 21 #include "ui/views/controls/link_listener.h" | 21 #include "ui/views/controls/link_listener.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 event->SetHandled(); | 122 event->SetHandled(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 bool Link::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) { | 125 bool Link::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) { |
| 126 // Make sure we don't process space or enter as accelerators. | 126 // Make sure we don't process space or enter as accelerators. |
| 127 return (event.key_code() == ui::VKEY_SPACE) || | 127 return (event.key_code() == ui::VKEY_SPACE) || |
| 128 (event.key_code() == ui::VKEY_RETURN); | 128 (event.key_code() == ui::VKEY_RETURN); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void Link::GetAccessibleState(ui::AXViewState* state) { | 131 void Link::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 132 Label::GetAccessibleState(state); | 132 Label::GetAccessibleNodeData(node_data); |
| 133 state->role = ui::AX_ROLE_LINK; | 133 node_data->role = ui::AX_ROLE_LINK; |
| 134 } | 134 } |
| 135 | 135 |
| 136 void Link::OnEnabledChanged() { | 136 void Link::OnEnabledChanged() { |
| 137 RecalculateFont(); | 137 RecalculateFont(); |
| 138 View::OnEnabledChanged(); | 138 View::OnEnabledChanged(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void Link::OnFocus() { | 141 void Link::OnFocus() { |
| 142 Label::OnFocus(); | 142 Label::OnFocus(); |
| 143 RecalculateFont(); | 143 RecalculateFont(); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 if (GetNativeTheme()) { | 239 if (GetNativeTheme()) { |
| 240 return GetNativeTheme()->GetSystemColor( | 240 return GetNativeTheme()->GetSystemColor( |
| 241 pressed_ ? ui::NativeTheme::kColorId_LinkPressed | 241 pressed_ ? ui::NativeTheme::kColorId_LinkPressed |
| 242 : ui::NativeTheme::kColorId_LinkEnabled); | 242 : ui::NativeTheme::kColorId_LinkEnabled); |
| 243 } | 243 } |
| 244 | 244 |
| 245 return gfx::kPlaceholderColor; | 245 return gfx::kPlaceholderColor; |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace views | 248 } // namespace views |
| OLD | NEW |