summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions/session_restore.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 18:41:52 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 18:41:52 +0000
commit5ae566d6f57c8c0071dad41dcd76b21a6dabe5ff (patch)
tree86b9009843aff0e724bea205342ce451855530c5 /chrome/browser/sessions/session_restore.cc
parent3f8cb62b2416b1365407eaaf935664509ebcef5c (diff)
downloadchromium_src-5ae566d6f57c8c0071dad41dcd76b21a6dabe5ff.zip
chromium_src-5ae566d6f57c8c0071dad41dcd76b21a6dabe5ff.tar.gz
chromium_src-5ae566d6f57c8c0071dad41dcd76b21a6dabe5ff.tar.bz2
Relanding the following:
When restoring a session, the browser is shown after a tab is selected causing the focus to be on the location bar (not tab contents for web pages). This CL ensures the tab decides where the focus should be after the browser is shown. BUG=6000 TEST=See bug R=sky Review URL: http://codereview.chromium.org/28156 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10488 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions/session_restore.cc')
-rw-r--r--chrome/browser/sessions/session_restore.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc
index ced5e90..bff9a74 100644
--- a/chrome/browser/sessions/session_restore.cc
+++ b/chrome/browser/sessions/session_restore.cc
@@ -359,6 +359,9 @@ class SessionRestoreImpl : public NotificationObserver {
std::min(initial_tab_count + std::max(0, selected_session_index),
browser->tab_count() - 1), true);
browser->window()->Show();
+ // Showing the browser focuses the location bar, let the tab decide where
+ // it wants the focus to be.
+ browser->GetSelectedTabContents()->SetInitialFocus();
}
void AppendURLsToBrowser(Browser* browser, const std::vector<GURL>& urls) {