summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-30 14:52:00 +0000
committerrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-30 14:52:00 +0000
commit900e7368646c6d45d62df9eb03f252cfacdf6111 (patch)
treec1da90d6d46a18aeac3ac94dc82cfc395ec7942b /chrome/browser
parent9a136cdf89222c11b0dae86e19ff0b14956f929a (diff)
downloadchromium_src-900e7368646c6d45d62df9eb03f252cfacdf6111.zip
chromium_src-900e7368646c6d45d62df9eb03f252cfacdf6111.tar.gz
chromium_src-900e7368646c6d45d62df9eb03f252cfacdf6111.tar.bz2
Minimal SetInitialFocus and RestoreFocus. These aren't final, but this
does resolve the location bar not being focused bug on the mac build. Patch by Sean Bryant (sean@cyberwang.net). BUG=9419 Review URL: http://codereview.chromium.org/100140 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14939 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_mac.mm6
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm
index 3d894c8..bcf7ab4 100644
--- a/chrome/browser/tab_contents/tab_contents_view_mac.mm
+++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm
@@ -107,7 +107,9 @@ void TabContentsViewMac::Focus() {
}
void TabContentsViewMac::SetInitialFocus() {
- // TODO(port)
+ // TODO(port): Set focus in the else case correctly.
+ if (web_contents()->FocusLocationBarByDefault())
+ web_contents()->delegate()->SetFocusToLocationBar();
}
void TabContentsViewMac::StoreFocus() {
@@ -116,6 +118,8 @@ void TabContentsViewMac::StoreFocus() {
void TabContentsViewMac::RestoreFocus() {
// TODO(port)
+ // For now just assume we are viewing the tab for the first time.
+ SetInitialFocus();
}
void TabContentsViewMac::UpdateDragCursor(bool is_drop_target) {