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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm

Issue 7033048: Multi-tab: Adding new Notification when tab selection changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebasing Created 9 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/gtk/browser_window_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
6 6
7 #import <QuartzCore/QuartzCore.h> 7 #import <QuartzCore/QuartzCore.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <string> 10 #include <string>
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 1208
1209 // Called when a notification is received from the model to select a particular 1209 // Called when a notification is received from the model to select a particular
1210 // tab. Swaps in the toolbar and content area associated with |newContents|. 1210 // tab. Swaps in the toolbar and content area associated with |newContents|.
1211 - (void)activateTabWithContents:(TabContentsWrapper*)newContents 1211 - (void)activateTabWithContents:(TabContentsWrapper*)newContents
1212 previousContents:(TabContentsWrapper*)oldContents 1212 previousContents:(TabContentsWrapper*)oldContents
1213 atIndex:(NSInteger)modelIndex 1213 atIndex:(NSInteger)modelIndex
1214 userGesture:(bool)wasUserGesture { 1214 userGesture:(bool)wasUserGesture {
1215 // Take closing tabs into account. 1215 // Take closing tabs into account.
1216 NSInteger activeIndex = [self indexFromModelIndex:modelIndex]; 1216 NSInteger activeIndex = [self indexFromModelIndex:modelIndex];
1217 1217
1218 if (oldContents && oldContents != newContents) { 1218 if (oldContents) {
1219 int oldModelIndex = 1219 int oldModelIndex =
1220 browser_->GetIndexOfController(&(oldContents->controller())); 1220 browser_->GetIndexOfController(&(oldContents->controller()));
1221 if (oldModelIndex != -1) { // When closing a tab, the old tab may be gone. 1221 if (oldModelIndex != -1) { // When closing a tab, the old tab may be gone.
1222 NSInteger oldIndex = [self indexFromModelIndex:oldModelIndex]; 1222 NSInteger oldIndex = [self indexFromModelIndex:oldModelIndex];
1223 TabContentsController* oldController = 1223 TabContentsController* oldController =
1224 [tabContentsArray_ objectAtIndex:oldIndex]; 1224 [tabContentsArray_ objectAtIndex:oldIndex];
1225 [oldController willBecomeUnselectedTab]; 1225 [oldController willBecomeUnselectedTab];
1226 oldContents->view()->StoreFocus(); 1226 oldContents->view()->StoreFocus();
1227 oldContents->tab_contents()->WasHidden(); 1227 oldContents->tab_contents()->WasHidden();
1228 } 1228 }
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
2136 } 2136 }
2137 2137
2138 std::string profileName = browser_->profile()->GetPrefs()->GetString( 2138 std::string profileName = browser_->profile()->GetPrefs()->GetString(
2139 prefs::kGoogleServicesUsername); 2139 prefs::kGoogleServicesUsername);
2140 [profileMenuButton_ setProfileDisplayName: 2140 [profileMenuButton_ setProfileDisplayName:
2141 [NSString stringWithUTF8String:profileName.c_str()]]; 2141 [NSString stringWithUTF8String:profileName.c_str()]];
2142 [profileMenuButton_ setHidden:NO]; 2142 [profileMenuButton_ setHidden:NO];
2143 } 2143 }
2144 2144
2145 @end 2145 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/gtk/browser_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698