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

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

Issue 2604303002: (Mac)Views: Widgets focus first View in traversal order if initial focus fails. (Closed)
Patch Set: Use views:: everywhere for consistency (?) Created 4 years 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
« ui/views/controls/focus_ring.cc ('K') | « ui/views/controls/focus_ring.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_delegate.cc
diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc
index 333adf9da1840b1f7f8f9f87973268d4f6694499..24a0c7cd1efd63fb0cf8c50b3c2970e0bded187e 100644
--- a/ui/views/window/dialog_delegate.cc
+++ b/ui/views/window/dialog_delegate.cc
@@ -163,8 +163,11 @@ bool DialogDelegate::IsDialogButtonEnabled(ui::DialogButton button) const {
}
View* DialogDelegate::GetInitiallyFocusedView() {
- // Focus the default button if any.
const DialogClientView* dcv = GetDialogClientView();
+ if (!dcv->GetFocusManager()->keyboard_accessible())
karandeepb 2016/12/30 21:16:04 null-check the focus manager? Did you test this
Patti Lor 2017/01/03 03:48:26 Oops, that's a mistake. I originally had the #ifde
karandeepb 2017/01/04 00:12:33 Yeah this seems reasonable to me as well, though o
+ return NULL;
+
+ // Focus the default button if any.
int default_button = GetDefaultDialogButton();
if (default_button == ui::DIALOG_BUTTON_NONE)
return NULL;
« ui/views/controls/focus_ring.cc ('K') | « ui/views/controls/focus_ring.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698