summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-06 00:18:01 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-06 00:18:01 +0000
commit429fafc44932326118e4067cd88084551ac321f4 (patch)
tree7c6c8027bf439541c7f48477fd42baeea60f9fe3
parentcc10e7c485e0e7c8423d9ad2e153cd8490f14ca7 (diff)
downloadchromium_src-429fafc44932326118e4067cd88084551ac321f4.zip
chromium_src-429fafc44932326118e4067cd88084551ac321f4.tar.gz
chromium_src-429fafc44932326118e4067cd88084551ac321f4.tar.bz2
[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
-rw-r--r--chrome/browser/chromeos/login/webui_login_view.cc7
-rw-r--r--chrome/browser/chromeos/login/webui_login_view.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/login/webui_login_view.cc b/chrome/browser/chromeos/login/webui_login_view.cc
index ba055f9..47c0f67 100644
--- a/chrome/browser/chromeos/login/webui_login_view.cc
+++ b/chrome/browser/chromeos/login/webui_login_view.cc
@@ -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
diff --git a/chrome/browser/chromeos/login/webui_login_view.h b/chrome/browser/chromeos/login/webui_login_view.h
index d8a6b4d..3d888c5 100644
--- a/chrome/browser/chromeos/login/webui_login_view.h
+++ b/chrome/browser/chromeos/login/webui_login_view.h
@@ -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