| Index: ui/views/controls/link.h
|
| diff --git a/ui/views/controls/link.h b/ui/views/controls/link.h
|
| index 928a727664d7377fc3b6ac0bc359279bb4f9db13..448adc5536125644679f51930ce13b583348bb90 100644
|
| --- a/ui/views/controls/link.h
|
| +++ b/ui/views/controls/link.h
|
| @@ -25,14 +25,35 @@ class LinkListener;
|
| ////////////////////////////////////////////////////////////////////////////////
|
| class VIEWS_EXPORT Link : public Label {
|
| public:
|
| + static const char kViewClassName[];
|
| +
|
| + // The padding for the focus ring border when rendering a focused Link with
|
| + // FocusStyle::RING.
|
| + static constexpr int kFocusBorderPadding = 1;
|
| +
|
| + // How the Link is styled when focused.
|
| + enum class FocusStyle {
|
| + UNDERLINE, // An underline style is added to the text only when focused.
|
| + RING, // A focus ring is drawn around the View.
|
| + };
|
| +
|
| Link();
|
| explicit Link(const base::string16& title);
|
| ~Link() override;
|
|
|
| + // Returns the default FocusStyle for a views::Link. Calling SetUnderline()
|
| + // may change it: E.g. SetUnderline(true) forces FocusStyle::RING.
|
| + static FocusStyle GetDefaultFocusStyle();
|
| +
|
| + // Returns the current FocusStyle of this Link.
|
| + FocusStyle GetFocusStyle() const;
|
| +
|
| const LinkListener* listener() { return listener_; }
|
| void set_listener(LinkListener* listener) { listener_ = listener; }
|
|
|
| // Label:
|
| + void PaintFocusRing(gfx::Canvas* canvas) const override;
|
| + gfx::Insets GetInsets() const override;
|
| const char* GetClassName() const override;
|
| gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override;
|
| bool CanProcessEventsWithinSubtree() const override;
|
| @@ -55,10 +76,10 @@ class VIEWS_EXPORT Link : public Label {
|
|
|
| // TODO(estade): almost all the places that call this pass false. With
|
| // Harmony, false is already the default so those callsites can be removed.
|
| + // TODO(tapted): Then remove all callsites when client code sets a correct
|
| + // typography style and derives this from style::GetFont(STYLE_LINK).
|
| void SetUnderline(bool underline);
|
|
|
| - static const char kViewClassName[];
|
| -
|
| private:
|
| void Init();
|
|
|
|
|