Commit 01e6b4ad authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Unified: Improve focus cycle of UnifiedSystemTray

This CL makes following improvements:
* Now first time Shift-Tab will focus on "Clear All" button.
* Now "Change" button for lock screen notification is included in
  focus cycle.

TEST=manual
BUG=880041

Change-Id: I3185936e505755a9d0de19c4425c285b3337e9ad
Reviewed-on: https://chromium-review.googlesource.com/c/1288110Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601014}
parent e090c590
...@@ -195,9 +195,14 @@ class UnifiedSystemTrayView::FocusSearch : public views::FocusSearch { ...@@ -195,9 +195,14 @@ class UnifiedSystemTrayView::FocusSearch : public views::FocusSearch {
FocusSearch::AnchoredDialogPolicy can_go_into_anchored_dialog, FocusSearch::AnchoredDialogPolicy can_go_into_anchored_dialog,
views::FocusTraversable** focus_traversable, views::FocusTraversable** focus_traversable,
views::View** focus_traversable_view) override { views::View** focus_traversable_view) override {
// Initial view that is focused when first time Tab or Shift-Tab is pressed.
views::View* default_start_view =
search_direction == FocusSearch::SearchDirection::kForwards
? view_->system_tray_container_
: view_->notification_hidden_view_;
return views::FocusSearch::FindNextFocusableView( return views::FocusSearch::FindNextFocusableView(
starting_view ? starting_view : view_->system_tray_container_, starting_view ? starting_view : default_start_view, search_direction,
search_direction, traversal_direction, traversal_direction,
starting_view ? check_starting_view starting_view ? check_starting_view
: StartingViewPolicy::kCheckStartingView, : StartingViewPolicy::kCheckStartingView,
can_go_into_anchored_dialog, focus_traversable, focus_traversable_view); can_go_into_anchored_dialog, focus_traversable, focus_traversable_view);
...@@ -276,8 +281,8 @@ UnifiedSystemTrayView::UnifiedSystemTrayView( ...@@ -276,8 +281,8 @@ UnifiedSystemTrayView::UnifiedSystemTrayView(
// |system_tray_container_|, but we have to complete the cycle by setting // |system_tray_container_|, but we have to complete the cycle by setting
// |message_center_view_| next to |detailed_view_container_|. // |message_center_view_| next to |detailed_view_container_|.
// Also, SetNextFocusableView does not support loop as mentioned in the doc, // Also, SetNextFocusableView does not support loop as mentioned in the doc,
// we have to set null to |message_center_view_|. // we have to set null to |notification_hidden_view_|.
message_center_view->SetNextFocusableView(nullptr); notification_hidden_view_->SetNextFocusableView(nullptr);
detailed_view_container_->SetNextFocusableView(message_center_view); detailed_view_container_->SetNextFocusableView(message_center_view);
top_shortcuts_view_->SetExpandedAmount(expanded_amount_); top_shortcuts_view_->SetExpandedAmount(expanded_amount_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment