summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-14 21:47:11 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-14 21:47:11 +0000
commit81d0e12189c2a6b7d27d85b1e33a14eb5b3afe19 (patch)
tree00cf7bb177c9f0c658a30d2bf44c8c6fcc729c65 /views
parent97033869f00d45640a1cf8726bec99b8260f8b4b (diff)
downloadchromium_src-81d0e12189c2a6b7d27d85b1e33a14eb5b3afe19.zip
chromium_src-81d0e12189c2a6b7d27d85b1e33a14eb5b3afe19.tar.gz
chromium_src-81d0e12189c2a6b7d27d85b1e33a14eb5b3afe19.tar.bz2
Fix focus traversal order in dialogs.
In a dialog, the contents view is added after the buttons have been added. That would mess up the focus traversal order. The problem was particularly visible in the basic auth dialog. This CL ensures the contents is added as the first view so the focus chain is right. BUG=42803 TEST=Open the options dialog. Make sure pressing Tab/Shift-Tab moves the focus correctly. Visit http://handle.library.cornell.edu/control/authBasic/authTest/ a basic auth dialog is shown. Make sure Tab/Shift-Tab moves the focus as expected. Review URL: http://codereview.chromium.org/3403002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59432 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/window/client_view.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/views/window/client_view.cc b/views/window/client_view.cc
index 1594386..fd03217 100644
--- a/views/window/client_view.cc
+++ b/views/window/client_view.cc
@@ -50,7 +50,9 @@ void ClientView::ViewHierarchyChanged(bool is_add, View* parent, View* child) {
if (is_add && child == this) {
DCHECK(GetWidget());
DCHECK(contents_view_); // |contents_view_| must be valid now!
- AddChildView(contents_view_);
+ // Insert |contents_view_| at index 0 so it is first in the focus chain.
+ // (the OK/Cancel buttons are inserted before contents_view_)
+ AddChildView(0, contents_view_);
}
}