| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_VIEWS_LABEL_H__ | 5 #ifndef CHROME_VIEWS_LABEL_H__ |
| 6 #define CHROME_VIEWS_LABEL_H__ | 6 #define CHROME_VIEWS_LABEL_H__ |
| 7 | 7 |
| 8 #include "chrome/common/gfx/chrome_font.h" | 8 #include "chrome/common/gfx/chrome_font.h" |
| 9 #include "chrome/views/view.h" | 9 #include "chrome/views/view.h" |
| 10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // the default behavior and lets you set a custom tooltip. To revert to | 132 // the default behavior and lets you set a custom tooltip. To revert to |
| 133 // default behavior, call this with an empty string. | 133 // default behavior, call this with an empty string. |
| 134 void SetTooltipText(const std::wstring& tooltip_text); | 134 void SetTooltipText(const std::wstring& tooltip_text); |
| 135 | 135 |
| 136 // Gets the tooltip text for labels that are wider than their bounds, except | 136 // Gets the tooltip text for labels that are wider than their bounds, except |
| 137 // when the label is multiline, in which case it just returns false (no | 137 // when the label is multiline, in which case it just returns false (no |
| 138 // tooltip). If a custom tooltip has been specified with SetTooltipText() | 138 // tooltip). If a custom tooltip has been specified with SetTooltipText() |
| 139 // it is returned instead. | 139 // it is returned instead. |
| 140 virtual bool GetTooltipText(int x, int y, std::wstring* tooltip); | 140 virtual bool GetTooltipText(int x, int y, std::wstring* tooltip); |
| 141 | 141 |
| 142 // Mouse enter/exit are overridden to render mouse over background color. Thes
e | 142 // Mouse enter/exit are overridden to render mouse over background color. |
| 143 // invoke SetContainsMouse as necessary. | 143 // These invoke SetContainsMouse as necessary. |
| 144 virtual void OnMouseMoved(const MouseEvent& e); | 144 virtual void OnMouseMoved(const MouseEvent& e); |
| 145 virtual void OnMouseEntered(const MouseEvent& event); | 145 virtual void OnMouseEntered(const MouseEvent& event); |
| 146 virtual void OnMouseExited(const MouseEvent& event); | 146 virtual void OnMouseExited(const MouseEvent& event); |
| 147 | 147 |
| 148 // The background color to use when the mouse is over the label. Label | 148 // The background color to use when the mouse is over the label. Label |
| 149 // takes ownership of the Background. | 149 // takes ownership of the Background. |
| 150 void SetMouseOverBackground(Background* background); | 150 void SetMouseOverBackground(Background* background); |
| 151 const Background* GetMouseOverBackground() const; | 151 const Background* GetMouseOverBackground() const; |
| 152 | 152 |
| 153 // Sets the enabled state. Setting the enabled state resets the color. | 153 // Sets the enabled state. Setting the enabled state resets the color. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 // needs to be flipped around for RTL locales. Please refer to the definition | 231 // needs to be flipped around for RTL locales. Please refer to the definition |
| 232 // of RTLAlignmentMode for more information. | 232 // of RTLAlignmentMode for more information. |
| 233 RTLAlignmentMode rtl_alignment_mode_; | 233 RTLAlignmentMode rtl_alignment_mode_; |
| 234 | 234 |
| 235 DISALLOW_COPY_AND_ASSIGN(Label); | 235 DISALLOW_COPY_AND_ASSIGN(Label); |
| 236 }; | 236 }; |
| 237 | 237 |
| 238 } // namespace views | 238 } // namespace views |
| 239 | 239 |
| 240 #endif // CHROME_VIEWS_VIEW_H__ | 240 #endif // CHROME_VIEWS_VIEW_H__ |
| OLD | NEW |