OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 retain]; | 1253 retain]; |
1254 static NSImage* sadFaviconImage = | 1254 static NSImage* sadFaviconImage = |
1255 [ResourceBundle::GetSharedInstance().GetNativeImageNamed(IDR_SAD_FAVICON) | 1255 [ResourceBundle::GetSharedInstance().GetNativeImageNamed(IDR_SAD_FAVICON) |
1256 retain]; | 1256 retain]; |
1257 | 1257 |
1258 // Take closing tabs into account. | 1258 // Take closing tabs into account. |
1259 NSInteger index = [self indexFromModelIndex:modelIndex]; | 1259 NSInteger index = [self indexFromModelIndex:modelIndex]; |
1260 TabController* tabController = [tabArray_ objectAtIndex:index]; | 1260 TabController* tabController = [tabArray_ objectAtIndex:index]; |
1261 | 1261 |
1262 bool oldHasIcon = [tabController iconView] != nil; | 1262 bool oldHasIcon = [tabController iconView] != nil; |
1263 bool newHasIcon = contents->ShouldDisplayFavIcon() || | 1263 bool newHasIcon = contents->ShouldDisplayFavicon() || |
1264 tabStripModel_->IsMiniTab(modelIndex); // Always show icon if mini. | 1264 tabStripModel_->IsMiniTab(modelIndex); // Always show icon if mini. |
1265 | 1265 |
1266 TabLoadingState oldState = [tabController loadingState]; | 1266 TabLoadingState oldState = [tabController loadingState]; |
1267 TabLoadingState newState = kTabDone; | 1267 TabLoadingState newState = kTabDone; |
1268 NSImage* throbberImage = nil; | 1268 NSImage* throbberImage = nil; |
1269 if (contents->is_crashed()) { | 1269 if (contents->is_crashed()) { |
1270 newState = kTabCrashed; | 1270 newState = kTabCrashed; |
1271 newHasIcon = true; | 1271 newHasIcon = true; |
1272 } else if (contents->waiting_for_response()) { | 1272 } else if (contents->waiting_for_response()) { |
1273 newState = kTabWaiting; | 1273 newState = kTabWaiting; |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1900 NSInteger index = [self indexFromModelIndex:modelIndex]; | 1900 NSInteger index = [self indexFromModelIndex:modelIndex]; |
1901 BrowserWindowController* controller = | 1901 BrowserWindowController* controller = |
1902 (BrowserWindowController*)[[switchView_ window] windowController]; | 1902 (BrowserWindowController*)[[switchView_ window] windowController]; |
1903 DCHECK(index >= 0); | 1903 DCHECK(index >= 0); |
1904 if (index >= 0) { | 1904 if (index >= 0) { |
1905 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; | 1905 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; |
1906 } | 1906 } |
1907 } | 1907 } |
1908 | 1908 |
1909 @end | 1909 @end |
OLD | NEW |