summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/tab_strip_controller.mm
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-20 22:40:11 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-20 22:40:11 +0000
commit2f28988ebe651238ac9f6e8b33ce6249c32f41bb (patch)
tree20486d6caf812e40bef8c49fddbd6b966ad57ef5 /chrome/browser/cocoa/tab_strip_controller.mm
parentc94cf0e2d1c871f35b57422e11b92c047a77f36c (diff)
downloadchromium_src-2f28988ebe651238ac9f6e8b33ce6249c32f41bb.zip
chromium_src-2f28988ebe651238ac9f6e8b33ce6249c32f41bb.tar.gz
chromium_src-2f28988ebe651238ac9f6e8b33ce6249c32f41bb.tar.bz2
Ensures the renderer gets focus/blur message when switching tabs.
BUG=26610 TEST=Open a page in a teb that prints out when the window object gets focused blured. Switch to another tab then come back to that tab. A blur and focus events should have been fired. Review URL: http://codereview.chromium.org/402091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/tab_strip_controller.mm')
-rw-r--r--chrome/browser/cocoa/tab_strip_controller.mm10
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm
index b619239..51bc6b4 100644
--- a/chrome/browser/cocoa/tab_strip_controller.mm
+++ b/chrome/browser/cocoa/tab_strip_controller.mm
@@ -896,8 +896,14 @@ private:
[self layoutTabs];
if (oldContents) {
- oldContents->view()->StoreFocus();
- oldContents->WasHidden();
+ int index = browser_->GetIndexOfController(&(oldContents->controller()));
+ if (index != -1) { // When closing a tab, the old tab may be gone.
+ TabContentsController* oldController =
+ [tabContentsArray_ objectAtIndex:index];
+ [oldController willBecomeUnselectedTab];
+ oldContents->view()->StoreFocus();
+ oldContents->WasHidden();
+ }
}
// Swap in the contents for the new tab.