Commit 429fafc4 authored by xiyuan@chromium.org's avatar xiyuan@chromium.org

[ChromeOS] Make WebUILoginView play nicer with focus.

- RequestFocus in LoadURL so that WebUILoginView is focused after window creation;
- Override TabContentsDelegate::TakeFocus and forward the focus back to web contents; This gets rid of the mysterious tab stop;

BUG=chromium-os:18466
TEST=Verify fix for chromium-os:18466.

Review URL: http://codereview.chromium.org/7506004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95694 0039d316-1c4b-4281-b951-d872f2087c98
parent cc10e7c4
......@@ -93,6 +93,7 @@ void WebUILoginView::UpdateWindowType() {
void WebUILoginView::LoadURL(const GURL & url) {
webui_login_->LoadURL(url);
webui_login_->RequestFocus();
}
WebUI* WebUILoginView::GetWebUI() {
......@@ -211,4 +212,10 @@ bool WebUILoginView::HandleContextMenu(const ContextMenuParams& params) {
#endif
}
bool WebUILoginView::TakeFocus(bool reverse) {
// Forward the focus back to web contents.
webui_login_->tab_contents()->FocusThroughTabTraversal(reverse);
return true;
}
} // namespace chromeos
......@@ -99,6 +99,7 @@ class WebUILoginView : public views::View,
private:
// Overridden from TabContentsDelegate.
virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE;
virtual bool TakeFocus(bool reverse) OVERRIDE;
// Window that contains status area.
// TODO(nkostylev): Temporary solution till we have
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment