summaryrefslogtreecommitdiffstats
path: root/ui/views/controls/link.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/views/controls/link.cc')
-rw-r--r--ui/views/controls/link.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/ui/views/controls/link.cc b/ui/views/controls/link.cc
index b2bcc8f..5a5729a 100644
--- a/ui/views/controls/link.cc
+++ b/ui/views/controls/link.cc
@@ -11,6 +11,7 @@
#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/events/event.h"
#include "ui/events/keycodes/keyboard_codes.h"
+#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/font.h"
#include "ui/views/controls/link_listener.h"
@@ -62,6 +63,25 @@ gfx::NativeCursor Link::GetCursor(const ui::MouseEvent& event) {
#endif
}
+void Link::OnPaint(gfx::Canvas* canvas) {
+ Label::OnPaint(canvas);
+
+ if (HasFocus())
+ canvas->DrawFocusRect(GetLocalBounds());
+}
+
+void Link::OnFocus() {
+ Label::OnFocus();
+ // We render differently focused.
+ SchedulePaint();
+}
+
+void Link::OnBlur() {
+ Label::OnBlur();
+ // We render differently focused.
+ SchedulePaint();
+}
+
bool Link::HitTestRect(const gfx::Rect& rect) const {
// We need to allow clicks on the link. So we override the implementation in
// Label and use the default implementation of View.