summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 19:43:35 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 19:43:35 +0000
commit68f009f757da08539881e8557e843d9b7b42ee94 (patch)
treeda0b0d845c2b93739276c4409423337027ab0cbe /chrome/browser
parent19f7242cf9ff43f7a3aee04ff34c931d829be4e8 (diff)
downloadchromium_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/browser')
-rw-r--r--chrome/browser/browser.cc3
-rw-r--r--chrome/browser/sessions/session_restore.cc4
-rw-r--r--chrome/browser/views/frame/browser_view.cc1
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;