Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(906)

Unified Diff: ui/views/controls/button/label_button.cc

Issue 13689002: LabelButton: SetAccessibleName on SetText; update test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on focusable change from crrev.com/192519 Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/accessibility/accessibility_event_router_views_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/label_button.cc
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc
index 6ca6a98194017f3476d310474ed5df20cbee658a..af3fb3fbb9e985ab2524b55200d466327dfeacf8 100644
--- a/ui/views/controls/button/label_button.cc
+++ b/ui/views/controls/button/label_button.cc
@@ -35,13 +35,14 @@ const char LabelButton::kViewClassName[] = "views/LabelButton";
LabelButton::LabelButton(ButtonListener* listener, const string16& text)
: CustomButton(listener),
image_(new ImageView()),
- label_(new Label(text)),
+ label_(new Label()),
tfarina 2013/04/05 12:44:27 you don't pass it through constructor anymore, bec
msw 2013/04/05 15:04:17 yes
button_state_images_(),
button_state_colors_(),
explicitly_set_colors_(),
is_default_(false),
style_(STYLE_TEXTBUTTON) {
SetAnimationDuration(kHoverAnimationDurationMs);
+ SetText(text);
AddChildView(image_);
image_->set_interactive(false);
@@ -72,6 +73,7 @@ const string16& LabelButton::GetText() const {
}
void LabelButton::SetText(const string16& text) {
+ SetAccessibleName(text);
label_->SetText(text);
}
« no previous file with comments | « chrome/browser/ui/views/accessibility/accessibility_event_router_views_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698