Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2440)

Unified Diff: chrome/browser/cocoa/tab_strip_controller.mm

Issue 402091: Fix tab focus/blur events on tab switch on the Mac (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/tab_contents_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « chrome/browser/cocoa/tab_contents_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698