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

Unified Diff: ash/common/system/tray/tray_details_view.cc

Issue 2434553003: [Ash MD] Restore focus on detailed row when exiting detailed view (Closed)
Patch Set: rebase Created 4 years, 2 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 | « no previous file | ash/common/system/tray/tray_details_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_details_view.cc
diff --git a/ash/common/system/tray/tray_details_view.cc b/ash/common/system/tray/tray_details_view.cc
index 41b2cf43198138d47df26947b869ada52ba5737b..c34c81bafa848cf0048dcb592ba386d6921b76bd 100644
--- a/ash/common/system/tray/tray_details_view.cc
+++ b/ash/common/system/tray/tray_details_view.cc
@@ -153,8 +153,15 @@ void TrayDetailsView::TransitionToDefaultView() {
// Cache pointer to owner in this function scope. TrayDetailsView will be
// deleted after called ShowDefaultView.
SystemTrayItem* owner = owner_;
- if (title_row_ && title_row_->content() && title_row_->content()->HasFocus())
- owner->set_restore_focus(true);
+ if (MaterialDesignController::IsSystemTrayMenuMaterial()) {
+ if (back_button_ && back_button_->HasFocus())
+ owner->set_restore_focus(true);
+ } else {
+ if (title_row_ && title_row_->content() &&
+ title_row_->content()->HasFocus()) {
+ owner->set_restore_focus(true);
+ }
+ }
owner->system_tray()->ShowDefaultView(BUBBLE_USE_EXISTING);
owner->set_restore_focus(false);
}
« no previous file with comments | « no previous file | ash/common/system/tray/tray_details_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698