summaryrefslogtreecommitdiffstats
path: root/views/widget
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 16:51:07 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 16:51:07 +0000
commit191e5a20da672688d842ad3b5e4c4c7bf8c6c71c (patch)
tree593c9052b68ca3ca24959caadbdcb8d5299f92d7 /views/widget
parente4221ad535d561b931bd900db9278825adf36b06 (diff)
downloadchromium_src-191e5a20da672688d842ad3b5e4c4c7bf8c6c71c.zip
chromium_src-191e5a20da672688d842ad3b5e4c4c7bf8c6c71c.tar.gz
chromium_src-191e5a20da672688d842ad3b5e4c4c7bf8c6c71c.tar.bz2
Turns on the focus traversal unit-tests and fixed some focus traversal problem:
- in TabbedPaneView, the focus traversable were not properly hooked-up - the NativeTextField was focusing the wrapper view instead of the actual Textfield view. Also in the FocusTraversal unit-test I had to select one of the radio-button that the test uses, as the behavior of focusing a disabled button is different on Windows (it forces any non disabled radio-button to become selected) than on Gtk. BUG=None TEST=Run the unit tests. Review URL: http://codereview.chromium.org/242163 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28263 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r--views/widget/root_view.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc
index dad1964..dd2ad8a 100644
--- a/views/widget/root_view.cc
+++ b/views/widget/root_view.cc
@@ -617,8 +617,13 @@ View* RootView::FindNextFocusableViewImpl(View* starting_view,
FocusTraversable** focus_traversable,
View** focus_traversable_view) {
if (check_starting_view) {
- if (IsViewFocusableCandidate(starting_view, skip_group_id))
- return FindSelectedViewForGroup(starting_view);
+ if (IsViewFocusableCandidate(starting_view, skip_group_id)) {
+ View* v = FindSelectedViewForGroup(starting_view);
+ // The selected view might not be focusable (if it is disabled for
+ // example).
+ if (v && v->IsFocusable())
+ return v;
+ }
*focus_traversable = starting_view->GetFocusTraversable();
if (*focus_traversable) {
@@ -710,7 +715,11 @@ View* RootView::FindPreviousFocusableViewImpl(
// a FocusTraversable, since we do not want to go down any more.
if (check_starting_view &&
IsViewFocusableCandidate(starting_view, skip_group_id)) {
- return FindSelectedViewForGroup(starting_view);
+ View* v = FindSelectedViewForGroup(starting_view);
+ // The selected view might not be focusable (if it is disabled for
+ // example).
+ if (v && v->IsFocusable())
+ return v;
}
// Then try the left sibling.