Chromium Code Reviews| Index: ash/system/tray/tray_views.cc |
| diff --git a/ash/system/tray/tray_views.cc b/ash/system/tray/tray_views.cc |
| index c09b5747e94e97812a1cdf871b3b2cf25ebb0164..e2f1afdcc7a18047649acaa64c1be81b2ccbd430 100644 |
| --- a/ash/system/tray/tray_views.cc |
| +++ b/ash/system/tray/tray_views.cc |
| @@ -65,6 +65,13 @@ bool ActionableView::OnMousePressed(const views::MouseEvent& event) { |
| return PerformAction(event); |
| } |
| +void ActionableView::OnPaintFocusBorder(gfx::Canvas* canvas) { |
| + if (HasFocus() && (focusable() || IsAccessibilityFocusable())) { |
| + canvas->DrawRect(gfx::Rect(1, 1, width() - 3, height() - 3), |
| + kFocusBorderColor); |
| + } |
| +} |
| + |
| //////////////////////////////////////////////////////////////////////////////// |
| // HoverHighlightView |
| @@ -176,6 +183,27 @@ void FixedSizedScrollView::OnPaintFocusBorder(gfx::Canvas* canvas) { |
| // Do not paint the focus border. |
| } |
| +//////////////////////////////////////////////////////////////////////////////// |
| +// AccessibleSlider |
| + |
| +AccessibleSlider::AccessibleSlider(views::SliderListener* listener, |
| + views::Slider::Orientation orientation) |
| + : views::Slider(listener, orientation) { |
| + // Add enough padding on all sides to make sure the focus border does not |
| + // overlap the slider. |
| + set_border(views::Border::CreateEmptyBorder(3, 3, 3, 3)); |
| +} |
| + |
| +AccessibleSlider::~AccessibleSlider() { |
| +} |
| + |
| +void AccessibleSlider::OnPaintFocusBorder(gfx::Canvas* canvas) { |
| + if (HasFocus() && (focusable() || IsAccessibilityFocusable())) { |
|
Ben Goodger (Google)
2012/04/13 15:26:29
Can you just add this to views::Slider?
sadrul
2012/04/13 15:48:36
Done (add Slider::set_focus_color so it can easily
|
| + canvas->DrawRect(gfx::Rect(1, 1, width() - 3, height() - 3), |
| + kFocusBorderColor); |
| + } |
| +} |
| + |
| views::View* CreateDetailedHeaderEntry(int string_id, |
| ViewClickListener* listener) { |
| ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |