OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 VIEWS_CONTROLS_LINK_H_ | 5 #ifndef VIEWS_CONTROLS_LINK_H_ |
6 #define VIEWS_CONTROLS_LINK_H_ | 6 #define VIEWS_CONTROLS_LINK_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "views/controls/label.h" | 10 #include "views/controls/label.h" |
11 | 11 |
12 namespace views { | 12 namespace views { |
13 | 13 |
14 class Link; | 14 class Link; |
15 | 15 |
16 //////////////////////////////////////////////////////////////////////////////// | 16 //////////////////////////////////////////////////////////////////////////////// |
17 // | 17 // |
18 // LinkController defines the method that should be implemented to | 18 // LinkController defines the method that should be implemented to |
19 // receive a notification when a link is clicked | 19 // receive a notification when a link is clicked |
20 // | 20 // |
21 //////////////////////////////////////////////////////////////////////////////// | 21 //////////////////////////////////////////////////////////////////////////////// |
22 class LinkController { | 22 class LinkController { |
23 public: | 23 public: |
24 virtual void LinkActivated(Link* source, int event_flags) = 0; | 24 virtual void LinkActivated(Link* source, int event_flags) = 0; |
| 25 |
| 26 protected: |
| 27 virtual ~LinkController() {} |
25 }; | 28 }; |
26 | 29 |
27 //////////////////////////////////////////////////////////////////////////////// | 30 //////////////////////////////////////////////////////////////////////////////// |
28 // | 31 // |
29 // Link class | 32 // Link class |
30 // | 33 // |
31 // A Link is a label subclass that looks like an HTML link. It has a | 34 // A Link is a label subclass that looks like an HTML link. It has a |
32 // controller which is notified when a click occurs. | 35 // controller which is notified when a click occurs. |
33 // | 36 // |
34 //////////////////////////////////////////////////////////////////////////////// | 37 //////////////////////////////////////////////////////////////////////////////// |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 98 |
96 // The color when the link is neither highlighted nor disabled. | 99 // The color when the link is neither highlighted nor disabled. |
97 SkColor normal_color_; | 100 SkColor normal_color_; |
98 | 101 |
99 DISALLOW_COPY_AND_ASSIGN(Link); | 102 DISALLOW_COPY_AND_ASSIGN(Link); |
100 }; | 103 }; |
101 | 104 |
102 } // namespace views | 105 } // namespace views |
103 | 106 |
104 #endif // VIEWS_CONTROLS_LINK_H_ | 107 #endif // VIEWS_CONTROLS_LINK_H_ |
OLD | NEW |