OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_LABEL_H_ | 5 #ifndef VIEWS_CONTROLS_LABEL_H_ |
6 #define VIEWS_CONTROLS_LABEL_H_ | 6 #define VIEWS_CONTROLS_LABEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // Overridden from View: | 154 // Overridden from View: |
155 virtual gfx::Insets GetInsets() const; | 155 virtual gfx::Insets GetInsets() const; |
156 virtual int GetBaseline() OVERRIDE; | 156 virtual int GetBaseline() OVERRIDE; |
157 // Overridden to compute the size required to display this label. | 157 // Overridden to compute the size required to display this label. |
158 virtual gfx::Size GetPreferredSize() OVERRIDE; | 158 virtual gfx::Size GetPreferredSize() OVERRIDE; |
159 // Return the height necessary to display this label with the provided width. | 159 // Return the height necessary to display this label with the provided width. |
160 // This method is used to layout multi-line labels. It is equivalent to | 160 // This method is used to layout multi-line labels. It is equivalent to |
161 // GetPreferredSize().height() if the receiver is not multi-line. | 161 // GetPreferredSize().height() if the receiver is not multi-line. |
162 virtual int GetHeightForWidth(int w); | 162 virtual int GetHeightForWidth(int w); |
163 // Sets the enabled state. Setting the enabled state resets the color. | 163 // Sets the enabled state. Setting the enabled state resets the color. |
164 virtual void SetEnabled(bool enabled) OVERRIDE; | 164 virtual void OnEnabledChanged() OVERRIDE; |
165 virtual std::string GetClassName() const OVERRIDE; | 165 virtual std::string GetClassName() const OVERRIDE; |
166 // Mouse enter/exit are overridden to render mouse over background color. | 166 // Mouse enter/exit are overridden to render mouse over background color. |
167 // These invoke SetContainsMouse as necessary. | 167 // These invoke SetContainsMouse as necessary. |
168 virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE; | 168 virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE; |
169 virtual void OnMouseEntered(const MouseEvent& event) OVERRIDE; | 169 virtual void OnMouseEntered(const MouseEvent& event) OVERRIDE; |
170 virtual void OnMouseExited(const MouseEvent& event) OVERRIDE; | 170 virtual void OnMouseExited(const MouseEvent& event) OVERRIDE; |
171 // Gets the tooltip text for labels that are wider than their bounds, except | 171 // Gets the tooltip text for labels that are wider than their bounds, except |
172 // when the label is multiline, in which case it just returns false (no | 172 // when the label is multiline, in which case it just returns false (no |
173 // tooltip). If a custom tooltip has been specified with SetTooltipText() | 173 // tooltip). If a custom tooltip has been specified with SetTooltipText() |
174 // it is returned instead. | 174 // it is returned instead. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 // allows this view to reserve space for a focus border that it otherwise | 259 // allows this view to reserve space for a focus border that it otherwise |
260 // might not have because it is not itself focusable. | 260 // might not have because it is not itself focusable. |
261 bool has_focus_border_; | 261 bool has_focus_border_; |
262 | 262 |
263 DISALLOW_COPY_AND_ASSIGN(Label); | 263 DISALLOW_COPY_AND_ASSIGN(Label); |
264 }; | 264 }; |
265 | 265 |
266 } // namespace views | 266 } // namespace views |
267 | 267 |
268 #endif // VIEWS_CONTROLS_LABEL_H_ | 268 #endif // VIEWS_CONTROLS_LABEL_H_ |
OLD | NEW |