summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-14 21:17:11 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-14 21:17:11 +0000
commite54f30d8f180827b528bd83ca05563e823d1121a (patch)
tree5797781ef64456756f6644d993a52dd2e4115f1c
parent4ae596dfdb8c8125a1d6df7a6f7edb6ed42d80fd (diff)
downloadchromium_src-e54f30d8f180827b528bd83ca05563e823d1121a.zip
chromium_src-e54f30d8f180827b528bd83ca05563e823d1121a.tar.gz
chromium_src-e54f30d8f180827b528bd83ca05563e823d1121a.tar.bz2
When opening a new tab by pressing CTRL-T in app mode, the location bar would not get focused.
This is because when the tab was shown its browser window is not yet active. BUG=6380 TEST=Open an app (ex: gmail), press CTRL-T, this opens a new browser with a new tab. Navigate to google.com in the new tab. Go back to the app, press CTRL-T again, a new tab should be opened and the location bar should have focus. Review URL: http://codereview.chromium.org/18017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8040 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browser.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 6f5cb590..0f0a099 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -659,6 +659,11 @@ void Browser::NewTab() {
Browser* b = GetOrCreateTabbedBrowser();
b->AddBlankTab(true);
b->window()->Show();
+ // The call to AddBlankTab above did not set the focus to the tab as its
+ // window was not active, so we have to do it explicitly.
+ // See http://crbug.com/6380.
+ TabContents* tab = b->GetSelectedTabContents();
+ tab->RestoreFocus();
}
}