| 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_LABEL_H_ | 5 #ifndef VIEWS_CONTROLS_LABEL_H_ |
| 6 #define VIEWS_CONTROLS_LABEL_H_ | 6 #define VIEWS_CONTROLS_LABEL_H_ |
| 7 | 7 |
| 8 #include "gfx/font.h" | 8 #include "gfx/font.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // Resizes the label so its width is set to the width of the longest line and | 166 // Resizes the label so its width is set to the width of the longest line and |
| 167 // its height deduced accordingly. | 167 // its height deduced accordingly. |
| 168 // This is only intended for multi-line labels and is useful when the label's | 168 // This is only intended for multi-line labels and is useful when the label's |
| 169 // text contains several lines separated with \n. | 169 // text contains several lines separated with \n. |
| 170 // |max_width| is the maximum width that will be used (longer lines will be | 170 // |max_width| is the maximum width that will be used (longer lines will be |
| 171 // wrapped). If 0, no maximum width is enforced. | 171 // wrapped). If 0, no maximum width is enforced. |
| 172 void SizeToFit(int max_width); | 172 void SizeToFit(int max_width); |
| 173 | 173 |
| 174 // Accessibility accessors, overridden from View. | 174 // Accessibility accessors, overridden from View. |
| 175 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); | 175 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); |
| 176 virtual bool GetAccessibleName(std::wstring* name); | |
| 177 virtual bool GetAccessibleState(AccessibilityTypes::State* state); | 176 virtual bool GetAccessibleState(AccessibilityTypes::State* state); |
| 178 | 177 |
| 179 // Gets/sets the flag to determine whether the label should be collapsed when | 178 // Gets/sets the flag to determine whether the label should be collapsed when |
| 180 // it's hidden (not visible). If this flag is true, the label will return a | 179 // it's hidden (not visible). If this flag is true, the label will return a |
| 181 // preferred size of (0, 0) when it's not visible. | 180 // preferred size of (0, 0) when it's not visible. |
| 182 void set_collapse_when_hidden(bool value) { collapse_when_hidden_ = value; } | 181 void set_collapse_when_hidden(bool value) { collapse_when_hidden_ = value; } |
| 183 bool collapse_when_hidden() const { return collapse_when_hidden_; } | 182 bool collapse_when_hidden() const { return collapse_when_hidden_; } |
| 184 | 183 |
| 185 void set_paint_as_focused(bool paint_as_focused) { | 184 void set_paint_as_focused(bool paint_as_focused) { |
| 186 paint_as_focused_ = paint_as_focused; | 185 paint_as_focused_ = paint_as_focused; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 // allows this view to reserve space for a focus border that it otherwise | 250 // allows this view to reserve space for a focus border that it otherwise |
| 252 // might not have because it is not itself focusable. | 251 // might not have because it is not itself focusable. |
| 253 bool has_focus_border_; | 252 bool has_focus_border_; |
| 254 | 253 |
| 255 DISALLOW_COPY_AND_ASSIGN(Label); | 254 DISALLOW_COPY_AND_ASSIGN(Label); |
| 256 }; | 255 }; |
| 257 | 256 |
| 258 } // namespace views | 257 } // namespace views |
| 259 | 258 |
| 260 #endif // VIEWS_CONTROLS_LABEL_H_ | 259 #endif // VIEWS_CONTROLS_LABEL_H_ |
| OLD | NEW |