| Index: ash/common/system/audio/volume_view.cc
|
| diff --git a/ash/common/system/audio/volume_view.cc b/ash/common/system/audio/volume_view.cc
|
| index 6435bac72442a11c2adea7f8446445d59eac75d7..ee36be3b6f38b960960e6f11cf6dcb9eb6ff4034 100644
|
| --- a/ash/common/system/audio/volume_view.cc
|
| +++ b/ash/common/system/audio/volume_view.cc
|
| @@ -15,6 +15,7 @@
|
| #include "ash/common/wm_shell.h"
|
| #include "grit/ash_resources.h"
|
| #include "grit/ash_strings.h"
|
| +#include "ui/accessibility/ax_view_state.h"
|
| #include "ui/base/resource/resource_bundle.h"
|
| #include "ui/gfx/canvas.h"
|
| #include "ui/gfx/image/image_skia_operations.h"
|
| @@ -26,6 +27,7 @@
|
| #include "ui/views/controls/image_view.h"
|
| #include "ui/views/controls/separator.h"
|
| #include "ui/views/layout/box_layout.h"
|
| +#include "ui/views/painter.h"
|
|
|
| namespace {
|
| const int kVolumeImageWidth = 25;
|
| @@ -54,6 +56,9 @@ class VolumeButton : public views::ToggleImageButton {
|
| : views::ToggleImageButton(listener),
|
| audio_delegate_(audio_delegate),
|
| image_index_(-1) {
|
| + SetFocusBehavior(FocusBehavior::ALWAYS);
|
| + SetFocusPainter(views::Painter::CreateSolidFocusPainter(
|
| + kFocusBorderColor, gfx::Insets(1, 1, 1, 1)));
|
| SetImageAlignment(ALIGN_CENTER, ALIGN_MIDDLE);
|
| image_ = ui::ResourceBundle::GetSharedInstance().GetImageNamed(
|
| IDR_AURA_UBER_TRAY_VOLUME_LEVELS);
|
| @@ -89,6 +94,14 @@ class VolumeButton : public views::ToggleImageButton {
|
| return size;
|
| }
|
|
|
| + void GetAccessibleState(ui::AXViewState* state) override {
|
| + ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
|
| + state->name = bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_VOLUME_MUTE);
|
| + state->role = ui::AX_ROLE_TOGGLE_BUTTON;
|
| + if (audio_delegate_->IsOutputAudioMuted())
|
| + state->AddStateFlag(ui::AX_STATE_PRESSED);
|
| + }
|
| +
|
| // views::CustomButton:
|
| void StateChanged() override {
|
| if (state() == STATE_HOVERED || state() == STATE_PRESSED) {
|
|
|