summaryrefslogtreecommitdiffstats
path: root/ash/system/tray/tray_views.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ash/system/tray/tray_views.cc')
-rw-r--r--ash/system/tray/tray_views.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/ash/system/tray/tray_views.cc b/ash/system/tray/tray_views.cc
index 1c2e75e..e278140 100644
--- a/ash/system/tray/tray_views.cc
+++ b/ash/system/tray/tray_views.cc
@@ -66,6 +66,10 @@ bool ActionableView::OnMousePressed(const views::MouseEvent& event) {
return PerformAction(event);
}
+void ActionableView::SetAccessibleName(const string16& name) {
+ accessible_name_ = name;
+}
+
void ActionableView::OnPaintFocusBorder(gfx::Canvas* canvas) {
if (HasFocus() && (focusable() || IsAccessibilityFocusable())) {
canvas->DrawRect(gfx::Rect(1, 1, width() - 3, height() - 3),
@@ -73,6 +77,11 @@ void ActionableView::OnPaintFocusBorder(gfx::Canvas* canvas) {
}
}
+void ActionableView::GetAccessibleState(ui::AccessibleViewState* state) {
+ state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON;
+ state->name = accessible_name_;
+}
+
////////////////////////////////////////////////////////////////////////////////
// HoverHighlightView
@@ -102,7 +111,7 @@ void HoverHighlightView::AddIconAndLabel(const SkBitmap& image,
label->SetFont(label->font().DeriveFont(0, style));
AddChildView(label);
- accessible_name_ = text;
+ SetAccessibleName(text);
}
void HoverHighlightView::AddLabel(const string16& text,
@@ -116,11 +125,7 @@ void HoverHighlightView::AddLabel(const string16& text,
label->SetDisabledColor(SkColorSetARGB(127, 0, 0, 0));
AddChildView(label);
- accessible_name_ = text;
-}
-
-void HoverHighlightView::SetAccessibleName(const string16& name) {
- accessible_name_ = name;
+ SetAccessibleName(text);
}
bool HoverHighlightView::PerformAction(const views::Event& event) {
@@ -147,11 +152,6 @@ void HoverHighlightView::OnMouseExited(const views::MouseEvent& event) {
SchedulePaint();
}
-void HoverHighlightView::GetAccessibleState(ui::AccessibleViewState* state) {
- state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON;
- state->name = accessible_name_;
-}
-
void HoverHighlightView::OnEnabledChanged() {
for (int i = 0; i < child_count(); ++i)
child_at(i)->SetEnabled(enabled());