diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 19:43:35 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 19:43:35 +0000 |
commit | 68f009f757da08539881e8557e843d9b7b42ee94 (patch) | |
tree | da0b0d845c2b93739276c4409423337027ab0cbe /chrome | |
parent | 19f7242cf9ff43f7a3aee04ff34c931d829be4e8 (diff) | |
download | chromium_src-68f009f757da08539881e8557e843d9b7b42ee94.zip chromium_src-68f009f757da08539881e8557e843d9b7b42ee94.tar.gz chromium_src-68f009f757da08539881e8557e843d9b7b42ee94.tar.bz2 |
This CL addresses several issues with focus in application mode:
- when started, the focus was not on the page (it was on the location bar, which is not shown)
- ALT-F4 would not work at that point since the location bar was focused but not showing
- since the location bar was focusable, tabbing through would focus it (causing the focus to go to the top window).
BUG=8124,6046,8126
TEST=See bugs.
R=sky
Review URL: http://codereview.chromium.org/28202
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10504 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser.cc | 3 | ||||
-rw-r--r-- | chrome/browser/sessions/session_restore.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 1 |
3 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 6b9fe7d..6f1bf44 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -321,6 +321,9 @@ void Browser::OpenApplicationWindow(Profile* profile, const GURL& url) { Browser* browser = Browser::CreateForApp(app_name, profile); browser->AddTabWithURL(url, GURL(), PageTransition::START_PAGE, true, NULL); browser->window()->Show(); + // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial + // focus explicitly. + browser->GetSelectedTabContents()->SetInitialFocus(); } /////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc index bff9a74..b6db981 100644 --- a/chrome/browser/sessions/session_restore.cc +++ b/chrome/browser/sessions/session_restore.cc @@ -359,8 +359,8 @@ 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. + // TODO(jcampan): http://crbug.com/8123 we should not need to set the + // initial focus explicitly. browser->GetSelectedTabContents()->SetInitialFocus(); } diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index b1dec82..0d9e081 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -1350,6 +1350,7 @@ int BrowserView::LayoutToolbar(int top) { Personalization::AdjustBrowserView(personalization_, &browser_view_width); #endif bool visible = IsToolbarVisible(); + toolbar_->GetLocationBarView()->SetFocusable(visible); int y = top - ((visible && IsTabStripVisible()) ? kToolbarTabStripVerticalOverlap : 0); int height = visible ? toolbar_->GetPreferredSize().height() : 0; |