| 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 // Overridden to compute the size required to display this label. | 178 // Overridden to compute the size required to display this label. |
| 179 virtual gfx::Size GetPreferredSize() OVERRIDE; | 179 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 180 // Returns the width of an ellipsis if the label is non-empty, or 0 otherwise. | 180 // Returns the width of an ellipsis if the label is non-empty, or 0 otherwise. |
| 181 virtual gfx::Size GetMinimumSize() OVERRIDE; | 181 virtual gfx::Size GetMinimumSize() OVERRIDE; |
| 182 // Returns the height necessary to display this label with the provided width. | 182 // Returns the height necessary to display this label with the provided width. |
| 183 // This method is used to layout multi-line labels. It is equivalent to | 183 // This method is used to layout multi-line labels. It is equivalent to |
| 184 // GetPreferredSize().height() if the receiver is not multi-line. | 184 // GetPreferredSize().height() if the receiver is not multi-line. |
| 185 virtual int GetHeightForWidth(int w) OVERRIDE; | 185 virtual int GetHeightForWidth(int w) OVERRIDE; |
| 186 virtual const char* GetClassName() const OVERRIDE; | 186 virtual const char* GetClassName() const OVERRIDE; |
| 187 virtual View* GetTooltipHandlerForPoint(const gfx::Point& point) OVERRIDE; | 187 virtual View* GetTooltipHandlerForPoint(const gfx::Point& point) OVERRIDE; |
| 188 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; | 188 virtual bool HitTestRect(const gfx::RectF& rect) const OVERRIDE; |
| 189 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 189 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; |
| 190 // Gets the tooltip text for labels that are wider than their bounds, except | 190 // Gets the tooltip text for labels that are wider than their bounds, except |
| 191 // when the label is multiline, in which case it just returns false (no | 191 // when the label is multiline, in which case it just returns false (no |
| 192 // tooltip). If a custom tooltip has been specified with SetTooltipText() | 192 // tooltip). If a custom tooltip has been specified with SetTooltipText() |
| 193 // it is returned instead. | 193 // it is returned instead. |
| 194 virtual bool GetTooltipText(const gfx::Point& p, | 194 virtual bool GetTooltipText(const gfx::Point& p, |
| 195 base::string16* tooltip) const OVERRIDE; | 195 base::string16* tooltip) const OVERRIDE; |
| 196 | 196 |
| 197 protected: | 197 protected: |
| 198 // Called by Paint to paint the text. Override this to change how | 198 // Called by Paint to paint the text. Override this to change how |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 // The cached heights to avoid recalculation in GetHeightForWidth(). | 299 // The cached heights to avoid recalculation in GetHeightForWidth(). |
| 300 std::vector<gfx::Size> cached_heights_; | 300 std::vector<gfx::Size> cached_heights_; |
| 301 int cached_heights_cursor_; | 301 int cached_heights_cursor_; |
| 302 | 302 |
| 303 DISALLOW_COPY_AND_ASSIGN(Label); | 303 DISALLOW_COPY_AND_ASSIGN(Label); |
| 304 }; | 304 }; |
| 305 | 305 |
| 306 } // namespace views | 306 } // namespace views |
| 307 | 307 |
| 308 #endif // UI_VIEWS_CONTROLS_LABEL_H_ | 308 #endif // UI_VIEWS_CONTROLS_LABEL_H_ |
| OLD | NEW |