diff options
author | avi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-13 23:29:02 +0000 |
---|---|---|
committer | avi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-13 23:29:02 +0000 |
commit | 23576484b6f85938f72a1c993bfdf754b0c54660 (patch) | |
tree | 9f82476f21cc6f849ec3945bfbac3953d79f7f02 /chrome/browser/cocoa/tab_strip_controller.mm | |
parent | 321792ef1baac764227d55fc944f32cf29e50c6a (diff) | |
download | chromium_src-23576484b6f85938f72a1c993bfdf754b0c54660.zip chromium_src-23576484b6f85938f72a1c993bfdf754b0c54660.tar.gz chromium_src-23576484b6f85938f72a1c993bfdf754b0c54660.tar.bz2 |
Save/restore the focused subview.
http://crbug.com/9420
Review URL: http://codereview.chromium.org/100358
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16013 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/tab_strip_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.mm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm index 88f1dac..bbc18f0 100644 --- a/chrome/browser/cocoa/tab_strip_controller.mm +++ b/chrome/browser/cocoa/tab_strip_controller.mm @@ -17,6 +17,7 @@ #import "chrome/browser/cocoa/tab_strip_model_observer_bridge.h" #import "chrome/browser/cocoa/tab_view.h" #include "chrome/browser/tab_contents/tab_contents.h" +#include "chrome/browser/tab_contents/tab_contents_view.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "grit/generated_resources.h" @@ -325,8 +326,14 @@ // size than surrounding tabs if the user has many. [self layoutTabs]; + if (oldContents) + oldContents->view()->StoreFocus(); + // Swap in the contents for the new tab [self swapInTabAtIndex:index]; + + if (newContents) + newContents->view()->RestoreFocus(); } // Called when a notification is received from the model that the given tab |