Focus the first/last element when the view is requested for focus by tab traversal.
commite0ed64f48c9bd4bfe0533dc1f7ffc26a9de6778c
authorfukino <fukino@chromium.org>
Fri, 3 Apr 2015 09:24:41 +0000 (3 02:24 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 3 Apr 2015 09:25:04 +0000 (3 09:25 +0000)
tree9a223a12464a77f7ce857098c49ca297c1bf9f02
parent9bca49efc858f871929863ee6e88d80f34fd3c58
Focus the first/last element when the view is requested for focus by tab traversal.

In ExtensionDialog, these unexpected behaviors are observed:
 - When the last focusable element has the focus and TAB is pressed, the first focusable element is not focused.
 - When the first focusable element has the focus and Shift+TAB is pressed, the last element is not focused.

This CL fixes these issues by adding the same handling as views::WebView.
https://code.google.com/p/chromium/codesearch#chromium/src/ui/views/controls/webview/webview.cc&q=WebView::AboutToRequestFocusFromTabTraversal&sq=package:chromium&type=cs&l=234

BUG=463030
TEST=run interactive_ui_tests --gtest_filter=ExtensionDialogUiTest.TabFocusLoop

Review URL: https://codereview.chromium.org/994863003

Cr-Commit-Position: refs/heads/master@{#323716}
chrome/browser/ui/views/extensions/extension_dialog_interactive_uitest.cc [new file with mode: 0644]
chrome/browser/ui/views/extensions/extension_view_views.cc
chrome/browser/ui/views/extensions/extension_view_views.h
chrome/chrome_tests.gypi
chrome/test/data/extensions/uitest/tab_traversal/main.html [new file with mode: 0644]
chrome/test/data/extensions/uitest/tab_traversal/manifest.json [new file with mode: 0644]
chrome/test/data/extensions/uitest/tab_traversal/script.js [new file with mode: 0644]