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

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: 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..e43a53171951b772d749966d298ddf23289bf9e8 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()),
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);
}
@@ -125,6 +127,8 @@ void LabelButton::SetStyle(ButtonStyle style) {
set_focus_border(FocusBorder::CreateDashedFocusBorder(3, 3, 3, 3));
if (style == STYLE_BUTTON || style_ == STYLE_NATIVE_TEXTBUTTON)
label_->SetHorizontalAlignment(gfx::ALIGN_CENTER);
+ if (style == STYLE_NATIVE_TEXTBUTTON)
msw 2013/04/05 01:06:18 This CL depends on this change from: https://coder
+ set_focusable(true);
if (style == STYLE_BUTTON) {
set_min_size(gfx::Size(70, 31));
const SkColor color = GetNativeTheme()->GetSystemColor(
« 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