Chromium Code Reviews| Index: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
| index 67f12778ef6851089ab58eb2ee7a5c069c756445..201d05f226b811b5f492e8b396e589efef7b2c72 100644 |
| --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
| +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
| @@ -679,7 +679,10 @@ NSImage* Overlay(NSImage* ground, NSImage* overlay, CGFloat alpha) { |
| // ensureContentsVisible (see below) sets content size and autoresizing |
| // properties. |
| [newView setFrame:[oldView frame]]; |
| - [switchView_ replaceSubview:oldView with:newView]; |
| + // Remove the old view first, to ensure ConstrainedWindowSheets keyed to the |
| + // old WebContents are removed before adding new ones. |
|
Avi (use Gerrit)
2016/02/29 17:27:23
As a side note, this sounds like a limitation of t
|
| + [oldView removeFromSuperview]; |
| + [switchView_ addSubview:newView]; |
| } else { |
| [newView setFrame:[switchView_ bounds]]; |
| [switchView_ addSubview:newView]; |
| @@ -1376,7 +1379,6 @@ NSImage* Overlay(NSImage* ground, NSImage* overlay, CGFloat alpha) { |
| TabContentsController* oldController = |
| [tabContentsArray_ objectAtIndex:oldIndex]; |
| [oldController willBecomeUnselectedTab]; |
| - oldContents->WasHidden(); |
| } |
| } |
| @@ -1402,10 +1404,8 @@ NSImage* Overlay(NSImage* ground, NSImage* overlay, CGFloat alpha) { |
| // Swap in the contents for the new tab. |
| [self swapInTabAtIndex:modelIndex]; |
| - if (newContents) { |
| - newContents->WasShown(); |
| + if (newContents) |
| newContents->RestoreFocus(); |
| - } |
| } |
| - (void)tabSelectionChanged { |