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( |