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

Unified Diff: ui/views/window/dialog_client_view.cc

Issue 1826433002: DialogClientView: Fix regression in Chrome Task Manager focusing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: ui/views/window/dialog_client_view.cc
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc
index 5b5db8b88a4ca586a446d74ad93a0a0006e5981f..391a4781050ca42ef5598a7c272c891308cf8bac 100644
--- a/ui/views/window/dialog_client_view.cc
+++ b/ui/views/window/dialog_client_view.cc
@@ -112,6 +112,8 @@ void DialogClientView::UpdateDialogButtons() {
delete cancel_button_;
cancel_button_ = NULL;
}
+
+ SetupFocusChain();
}
///////////////////////////////////////////////////////////////////////////////
@@ -233,8 +235,6 @@ void DialogClientView::ViewHierarchyChanged(
else if (details.child == extra_view_)
extra_view_ = nullptr;
}
-
- SetupFocusChain();
}
void DialogClientView::OnNativeThemeChanged(const ui::NativeTheme* theme) {
@@ -286,6 +286,7 @@ void DialogClientView::CreateExtraView() {
if (extra_view_) {
extra_view_->SetGroup(kButtonGroup);
AddChildView(extra_view_);
+ SetupFocusChain();
}
}
@@ -360,11 +361,9 @@ void DialogClientView::SetupFocusChain() {
std::remove(child_views.begin(), child_views.end(), nullptr),
child_views.end());
- // Setup focus.
- for (size_t i = 0; i < child_views.size(); i++) {
- child_views[i]->SetNextFocusableView(
- i + 1 != child_views.size() ? child_views[i + 1] : nullptr);
- }
+ // Setup focus by reordering views.
sky 2016/04/07 19:09:37 You should document why this doesn't use SetNextFo
karandeepb 2016/04/08 01:40:43 Done.
+ for (size_t i = 0; i < child_views.size(); i++)
+ ReorderChildView(child_views[i], i);
}
} // namespace views
« no previous file with comments | « no previous file | ui/views/window/dialog_client_view_unittest.cc » ('j') | ui/views/window/dialog_client_view_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698