OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <cmath> | 9 #include <cmath> |
10 #include <limits> | 10 #include <limits> |
(...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 1547 ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
1548 IDR_THROBBER).CopyNSImage(); | 1548 IDR_THROBBER).CopyNSImage(); |
1549 static NSImage* sadFaviconImage = | 1549 static NSImage* sadFaviconImage = |
1550 ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 1550 ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
1551 IDR_SAD_FAVICON).CopyNSImage(); | 1551 IDR_SAD_FAVICON).CopyNSImage(); |
1552 | 1552 |
1553 // Take closing tabs into account. | 1553 // Take closing tabs into account. |
1554 NSInteger index = [self indexFromModelIndex:modelIndex]; | 1554 NSInteger index = [self indexFromModelIndex:modelIndex]; |
1555 TabController* tabController = [tabArray_ objectAtIndex:index]; | 1555 TabController* tabController = [tabArray_ objectAtIndex:index]; |
1556 | 1556 |
1557 FaviconTabHelper* favicon_tab_helper = | |
1558 FaviconTabHelper::FromWebContents(contents); | |
1559 bool oldHasIcon = [tabController iconView] != nil; | 1557 bool oldHasIcon = [tabController iconView] != nil; |
1560 bool newHasIcon = favicon_tab_helper->ShouldDisplayFavicon() || | 1558 bool newHasIcon = FaviconTabHelper::ShouldDisplayFavicon(contents) || |
1561 tabStripModel_->IsMiniTab(modelIndex); // Always show icon if mini. | 1559 tabStripModel_->IsMiniTab(modelIndex); // Always show icon if mini. |
1562 | 1560 |
1563 TabLoadingState oldState = [tabController loadingState]; | 1561 TabLoadingState oldState = [tabController loadingState]; |
1564 TabLoadingState newState = kTabDone; | 1562 TabLoadingState newState = kTabDone; |
1565 NSImage* throbberImage = nil; | 1563 NSImage* throbberImage = nil; |
1566 if (contents->IsCrashed()) { | 1564 if (contents->IsCrashed()) { |
1567 newState = kTabCrashed; | 1565 newState = kTabCrashed; |
1568 newHasIcon = true; | 1566 newHasIcon = true; |
1569 } else if (contents->IsWaitingForResponse()) { | 1567 } else if (contents->IsWaitingForResponse()) { |
1570 newState = kTabWaiting; | 1568 newState = kTabWaiting; |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2282 forButtonState:image_button_cell::kHoverStateBackground]; | 2280 forButtonState:image_button_cell::kHoverStateBackground]; |
2283 } else { | 2281 } else { |
2284 [[newTabButton_ cell] setImage:nil | 2282 [[newTabButton_ cell] setImage:nil |
2285 forButtonState:image_button_cell::kDefaultStateBackground]; | 2283 forButtonState:image_button_cell::kDefaultStateBackground]; |
2286 [[newTabButton_ cell] setImage:nil | 2284 [[newTabButton_ cell] setImage:nil |
2287 forButtonState:image_button_cell::kHoverStateBackground]; | 2285 forButtonState:image_button_cell::kHoverStateBackground]; |
2288 } | 2286 } |
2289 } | 2287 } |
2290 | 2288 |
2291 @end | 2289 @end |
OLD | NEW |