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

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

Issue 449056: Mac: change tab change notifications to pass full TabChangeType. (Closed)
Patch Set: Rebased ToT. Created 11 years 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/cocoa/tab_strip_controller.h" 5 #import "chrome/browser/cocoa/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 10
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 1105
1106 [tabController setIconView:iconView]; 1106 [tabController setIconView:iconView];
1107 } 1107 }
1108 } 1108 }
1109 1109
1110 // Called when a notification is received from the model that the given tab 1110 // Called when a notification is received from the model that the given tab
1111 // has been updated. |loading| will be YES when we only want to update the 1111 // has been updated. |loading| will be YES when we only want to update the
1112 // throbber state, not anything else about the (partially) loading tab. 1112 // throbber state, not anything else about the (partially) loading tab.
1113 - (void)tabChangedWithContents:(TabContents*)contents 1113 - (void)tabChangedWithContents:(TabContents*)contents
1114 atIndex:(NSInteger)modelIndex 1114 atIndex:(NSInteger)modelIndex
1115 loadingOnly:(BOOL)loading { 1115 changeType:(TabStripModelObserver::TabChangeType)change {
1116 // Take closing tabs into account. 1116 // Take closing tabs into account.
1117 NSInteger index = [self indexFromModelIndex:modelIndex]; 1117 NSInteger index = [self indexFromModelIndex:modelIndex];
1118 1118
1119 if (!loading) 1119 if (change == TabStripModelObserver::TITLE_NOT_LOADING) {
1120 // TODO(sky): make this work.
1121 // We'll receive another notification of the change asynchronously.
1122 return;
1123 }
1124
1125 if (change != TabStripModelObserver::LOADING_ONLY)
1120 [self setTabTitle:[tabArray_ objectAtIndex:index] withContents:contents]; 1126 [self setTabTitle:[tabArray_ objectAtIndex:index] withContents:contents];
1121 1127
1122 [self updateFavIconForContents:contents atIndex:index]; 1128 [self updateFavIconForContents:contents atIndex:index];
1123 1129
1124 TabContentsController* updatedController = 1130 TabContentsController* updatedController =
1125 [tabContentsArray_ objectAtIndex:index]; 1131 [tabContentsArray_ objectAtIndex:index];
1126 [updatedController tabDidChange:contents]; 1132 [updatedController tabDidChange:contents];
1127 } 1133 }
1128 1134
1129 // Called when a tab is moved (usually by drag&drop). Keep our parallel arrays 1135 // Called when a tab is moved (usually by drag&drop). Keep our parallel arrays
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 // Show next sheet 1495 // Show next sheet
1490 NSWindowController* controller = [[tab window] windowController]; 1496 NSWindowController* controller = [[tab window] windowController];
1491 DCHECK([controller isKindOfClass:[BrowserWindowController class]]); 1497 DCHECK([controller isKindOfClass:[BrowserWindowController class]]);
1492 windows.front()->Realize( 1498 windows.front()->Realize(
1493 static_cast<BrowserWindowController*>(controller)); 1499 static_cast<BrowserWindowController*>(controller));
1494 } 1500 }
1495 } 1501 }
1496 } 1502 }
1497 1503
1498 @end 1504 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/browser_window_controller.mm ('k') | chrome/browser/cocoa/tab_strip_model_observer_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698