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_LABEL_H_ | 5 #ifndef UI_VIEWS_CONTROLS_LABEL_H_ |
6 #define UI_VIEWS_CONTROLS_LABEL_H_ | 6 #define UI_VIEWS_CONTROLS_LABEL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // Overridden from View: | 171 // Overridden from View: |
172 virtual gfx::Insets GetInsets() const OVERRIDE; | 172 virtual gfx::Insets GetInsets() const OVERRIDE; |
173 virtual int GetBaseline() const OVERRIDE; | 173 virtual int GetBaseline() const OVERRIDE; |
174 // Overridden to compute the size required to display this label. | 174 // Overridden to compute the size required to display this label. |
175 virtual gfx::Size GetPreferredSize() OVERRIDE; | 175 virtual gfx::Size GetPreferredSize() OVERRIDE; |
176 // Returns the height necessary to display this label with the provided width. | 176 // Returns the height necessary to display this label with the provided width. |
177 // This method is used to layout multi-line labels. It is equivalent to | 177 // This method is used to layout multi-line labels. It is equivalent to |
178 // GetPreferredSize().height() if the receiver is not multi-line. | 178 // GetPreferredSize().height() if the receiver is not multi-line. |
179 virtual int GetHeightForWidth(int w) OVERRIDE; | 179 virtual int GetHeightForWidth(int w) OVERRIDE; |
180 virtual std::string GetClassName() const OVERRIDE; | 180 virtual std::string GetClassName() const OVERRIDE; |
181 virtual bool HitTest(const gfx::Point& l) const OVERRIDE; | 181 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; |
182 // Mouse enter/exit are overridden to render mouse over background color. | 182 // Mouse enter/exit are overridden to render mouse over background color. |
183 // These invoke SetContainsMouse as necessary. | 183 // These invoke SetContainsMouse as necessary. |
184 virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE; | 184 virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE; |
185 virtual void OnMouseEntered(const MouseEvent& event) OVERRIDE; | 185 virtual void OnMouseEntered(const MouseEvent& event) OVERRIDE; |
186 virtual void OnMouseExited(const MouseEvent& event) OVERRIDE; | 186 virtual void OnMouseExited(const MouseEvent& event) OVERRIDE; |
187 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 187 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
188 // Gets the tooltip text for labels that are wider than their bounds, except | 188 // Gets the tooltip text for labels that are wider than their bounds, except |
189 // when the label is multiline, in which case it just returns false (no | 189 // when the label is multiline, in which case it just returns false (no |
190 // tooltip). If a custom tooltip has been specified with SetTooltipText() | 190 // tooltip). If a custom tooltip has been specified with SetTooltipText() |
191 // it is returned instead. | 191 // it is returned instead. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 // Should a shadow be drawn behind the text? | 296 // Should a shadow be drawn behind the text? |
297 bool has_shadow_; | 297 bool has_shadow_; |
298 | 298 |
299 | 299 |
300 DISALLOW_COPY_AND_ASSIGN(Label); | 300 DISALLOW_COPY_AND_ASSIGN(Label); |
301 }; | 301 }; |
302 | 302 |
303 } // namespace views | 303 } // namespace views |
304 | 304 |
305 #endif // UI_VIEWS_CONTROLS_LABEL_H_ | 305 #endif // UI_VIEWS_CONTROLS_LABEL_H_ |
OLD | NEW |