| 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 #ifndef UI_VIEWS_CONTROLS_LINK_H_ | 5 #ifndef UI_VIEWS_CONTROLS_LINK_H_ |
| 6 #define UI_VIEWS_CONTROLS_LINK_H_ | 6 #define UI_VIEWS_CONTROLS_LINK_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "third_party/skia/include/core/SkColor.h" |
| 10 #include "ui/views/controls/label.h" | 11 #include "ui/views/controls/label.h" |
| 11 | 12 |
| 12 namespace views { | 13 namespace views { |
| 13 | 14 |
| 14 class LinkListener; | 15 class LinkListener; |
| 15 | 16 |
| 16 //////////////////////////////////////////////////////////////////////////////// | 17 //////////////////////////////////////////////////////////////////////////////// |
| 17 // | 18 // |
| 18 // Link class | 19 // Link class |
| 19 // | 20 // |
| 20 // A Link is a label subclass that looks like an HTML link. It has a | 21 // A Link is a label subclass that looks like an HTML link. It has a |
| 21 // controller which is notified when a click occurs. | 22 // controller which is notified when a click occurs. |
| 22 // | 23 // |
| 23 //////////////////////////////////////////////////////////////////////////////// | 24 //////////////////////////////////////////////////////////////////////////////// |
| 24 class VIEWS_EXPORT Link : public Label { | 25 class VIEWS_EXPORT Link : public Label { |
| 25 public: | 26 public: |
| 26 Link(); | 27 Link(); |
| 27 explicit Link(const string16& title); | 28 explicit Link(const string16& title); |
| 28 virtual ~Link(); | 29 virtual ~Link(); |
| 29 | 30 |
| 31 static SkColor GetDefaultEnabledColor(); |
| 32 |
| 30 const LinkListener* listener() { return listener_; } | 33 const LinkListener* listener() { return listener_; } |
| 31 void set_listener(LinkListener* listener) { listener_ = listener; } | 34 void set_listener(LinkListener* listener) { listener_ = listener; } |
| 32 | 35 |
| 33 // Overridden from View: | 36 // Overridden from View: |
| 34 virtual void OnEnabledChanged() OVERRIDE; | 37 virtual void OnEnabledChanged() OVERRIDE; |
| 35 virtual const char* GetClassName() const OVERRIDE; | 38 virtual const char* GetClassName() const OVERRIDE; |
| 36 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; | 39 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; |
| 37 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; | 40 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; |
| 38 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 41 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
| 39 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; | 42 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 79 |
| 77 // The color when the link is pressed. | 80 // The color when the link is pressed. |
| 78 SkColor requested_pressed_color_; | 81 SkColor requested_pressed_color_; |
| 79 | 82 |
| 80 DISALLOW_COPY_AND_ASSIGN(Link); | 83 DISALLOW_COPY_AND_ASSIGN(Link); |
| 81 }; | 84 }; |
| 82 | 85 |
| 83 } // namespace views | 86 } // namespace views |
| 84 | 87 |
| 85 #endif // UI_VIEWS_CONTROLS_LINK_H_ | 88 #endif // UI_VIEWS_CONTROLS_LINK_H_ |
| OLD | NEW |