Commit 704db340 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Unified: Get default focus on detailed view.

In UnifiedSystemTray, detailed view did not get focus when it is
transitioned by keyboard.

TEST=manual
BUG=862504

Change-Id: I9f39359d3fa72be4bff5d42e5a9f98144b1a1bad
Reviewed-on: https://chromium-review.googlesource.com/1132899Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574461}
parent bec21faa
...@@ -469,4 +469,9 @@ int TrayDetailedView::GetHeightForWidth(int width) const { ...@@ -469,4 +469,9 @@ int TrayDetailedView::GetHeightForWidth(int width) const {
return height(); return height();
} }
void TrayDetailedView::RequestFocus() {
if (back_button_)
back_button_->RequestFocus();
}
} // namespace ash } // namespace ash
...@@ -52,6 +52,7 @@ class ASH_EXPORT TrayDetailedView : public views::View, ...@@ -52,6 +52,7 @@ class ASH_EXPORT TrayDetailedView : public views::View,
// views::View: // views::View:
void Layout() override; void Layout() override;
int GetHeightForWidth(int width) const override; int GetHeightForWidth(int width) const override;
void RequestFocus() override;
// Exposes the layout manager of this view to give control to subclasses. // Exposes the layout manager of this view to give control to subclasses.
views::BoxLayout* box_layout() { return box_layout_; } views::BoxLayout* box_layout() { return box_layout_; }
......
...@@ -367,8 +367,8 @@ void UnifiedSystemTrayController::ShowDetailedView( ...@@ -367,8 +367,8 @@ void UnifiedSystemTrayController::ShowDetailedView(
animation_->Reset(1.0); animation_->Reset(1.0);
UpdateExpandedAmount(); UpdateExpandedAmount();
unified_view_->SetDetailedView(controller->CreateView());
unified_view_->SaveFeaturePodFocus(); unified_view_->SaveFeaturePodFocus();
unified_view_->SetDetailedView(controller->CreateView());
detailed_view_controller_ = std::move(controller); detailed_view_controller_ = std::move(controller);
} }
......
...@@ -199,6 +199,8 @@ void UnifiedSystemTrayView::SetDetailedView(views::View* detailed_view) { ...@@ -199,6 +199,8 @@ void UnifiedSystemTrayView::SetDetailedView(views::View* detailed_view) {
detailed_view_container_->SetPreferredSize(system_tray_size); detailed_view_container_->SetPreferredSize(system_tray_size);
detailed_view->InvalidateLayout(); detailed_view->InvalidateLayout();
Layout(); Layout();
detailed_view->RequestFocus();
} }
void UnifiedSystemTrayView::ResetDetailedView() { void UnifiedSystemTrayView::ResetDetailedView() {
......
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