| Index: chrome/browser/cocoa/tab_strip_controller.mm
|
| ===================================================================
|
| --- chrome/browser/cocoa/tab_strip_controller.mm (revision 32459)
|
| +++ chrome/browser/cocoa/tab_strip_controller.mm (working copy)
|
| @@ -896,8 +896,14 @@
|
| [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.
|
|
|