Index: ash/system/tray/tray_background_view.cc |
diff --git a/ash/system/tray/tray_background_view.cc b/ash/system/tray/tray_background_view.cc |
index 67e15580279f10b55588f5a1b50ba59a045a767b..2a87185cecc0e9ec55bd017e0b04a824920990c1 100644 |
--- a/ash/system/tray/tray_background_view.cc |
+++ b/ash/system/tray/tray_background_view.cc |
@@ -11,6 +11,7 @@ |
#include "ash/system/status_area_widget_delegate.h" |
#include "ash/system/tray/tray_constants.h" |
#include "ui/aura/window.h" |
+#include "ui/base/accessibility/accessible_view_state.h" |
#include "ui/compositor/layer_animation_observer.h" |
#include "ui/gfx/canvas.h" |
#include "ui/gfx/skia_util.h" |
@@ -206,10 +207,15 @@ void TrayBackgroundView::OnPaintFocusBorder(gfx::Canvas* canvas) { |
// The tray itself expands to the right and bottom edge of the screen to make |
// sure clicking on the edges brings up the popup. However, the focus border |
// should be only around the container. |
- if (GetWidget() && GetWidget()->IsActive()) |
+ if (HasFocus() && (focusable() || IsAccessibilityFocusable())) |
DrawBorder(canvas, GetContentsBounds()); |
} |
+void TrayBackgroundView::GetAccessibleState(ui::AccessibleViewState* state) { |
+ state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
+ state->name = GetAccessibleName(); |
+} |
+ |
void TrayBackgroundView::AboutToRequestFocusFromTabTraversal(bool reverse) { |
// Return focus to the login view. See crbug.com/120500. |
views::View* v = GetNextFocusableView(); |
@@ -251,9 +257,8 @@ void TrayBackgroundView::SetShelfAlignment(ShelfAlignment alignment) { |
void TrayBackgroundView::SetBorder() { |
views::View* parent = status_area_widget_->status_area_widget_delegate(); |
- int child_count = parent->child_count(); |
- DCHECK(child_count > 0); |
- int on_edge = (this == parent->child_at(child_count-1)); |
+ // Tray views are laid out right-to-left or bottom-to-top |
+ int on_edge = (this == parent->child_at(0)); |
// Change the border padding for different shelf alignment. |
if (shelf_alignment() == SHELF_ALIGNMENT_BOTTOM) { |
set_border(views::Border::CreateEmptyBorder( |