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

Unified Diff: ash/common/system/audio/volume_view.cc

Issue 2234823003: Make the mute button in the Ash system menu keyboard focusable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « ash/ash_strings.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..53a0ce888a70996b348dbff895b272db1b0301cb 100644
--- a/ash/common/system/audio/volume_view.cc
+++ b/ash/common/system/audio/volume_view.cc
@@ -26,6 +26,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,9 +55,17 @@ class VolumeButton : public views::ToggleImageButton {
: views::ToggleImageButton(listener),
audio_delegate_(audio_delegate),
image_index_(-1) {
+ ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
+
+ SetFocusBehavior(FocusBehavior::ALWAYS);
+ SetFocusPainter(views::Painter::CreateSolidFocusPainter(
+ kFocusBorderColor, gfx::Insets(1, 1, 1, 1)));
+ SetAccessibleName(
David Tseng 2016/08/10 15:41:02 Could you override View::GetAccessibleState(AXView
tdanderson 2016/08/10 20:24:33 If I'm understanding the code correctly, it looks
+ bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_VOLUME_MUTE));
+
SetImageAlignment(ALIGN_CENTER, ALIGN_MIDDLE);
- image_ = ui::ResourceBundle::GetSharedInstance().GetImageNamed(
- IDR_AURA_UBER_TRAY_VOLUME_LEVELS);
+ image_ = bundle.GetImageNamed(IDR_AURA_UBER_TRAY_VOLUME_LEVELS);
+
Update();
}
« no previous file with comments | « ash/ash_strings.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698