diff options
author | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 18:05:14 +0000 |
---|---|---|
committer | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 18:05:14 +0000 |
commit | 2b57f5460c86978c881bccd79d9272388a98312f (patch) | |
tree | 595d6d5b453236f83903d6f70194cda2d5a8bc81 /chrome/browser/cocoa | |
parent | 9495e20a61ef7cb79a6ca2e3a70a1042a252bee6 (diff) | |
download | chromium_src-2b57f5460c86978c881bccd79d9272388a98312f.zip chromium_src-2b57f5460c86978c881bccd79d9272388a98312f.tar.gz chromium_src-2b57f5460c86978c881bccd79d9272388a98312f.tar.bz2 |
Fixes focus issues when browsing on Mac.
http://crbug.com/10032
TEST=Open a new tab and browse to www.google.com. Type something
and check that focus is correctly set to the text field.
Review URL: http://codereview.chromium.org/99327
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15226 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r-- | chrome/browser/cocoa/tab_contents_controller.mm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/tab_contents_controller.mm b/chrome/browser/cocoa/tab_contents_controller.mm index 68fb0de..8898a87 100644 --- a/chrome/browser/cocoa/tab_contents_controller.mm +++ b/chrome/browser/cocoa/tab_contents_controller.mm @@ -49,8 +49,13 @@ } - (void)tabDidChange:(TabContents*)updatedContents { - contents_ = updatedContents; - [contentsBox_ setContentView:contents_->GetNativeView()]; + // Calling setContentView: here removes any first responder status + // the view may have, so avoid changing the view hierarchy unless + // the view is different. + if (contents_ != updatedContents) { + contents_ = updatedContents; + [contentsBox_ setContentView:contents_->GetNativeView()]; + } } // Return the rect, in WebKit coordinates (flipped), of the window's grow box |