| 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 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1459 ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 1459 ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
| 1460 IDR_THROBBER).CopyNSImage(); | 1460 IDR_THROBBER).CopyNSImage(); |
| 1461 static NSImage* sadFaviconImage = | 1461 static NSImage* sadFaviconImage = |
| 1462 ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 1462 ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
| 1463 IDR_SAD_FAVICON).CopyNSImage(); | 1463 IDR_SAD_FAVICON).CopyNSImage(); |
| 1464 | 1464 |
| 1465 // Take closing tabs into account. | 1465 // Take closing tabs into account. |
| 1466 NSInteger index = [self indexFromModelIndex:modelIndex]; | 1466 NSInteger index = [self indexFromModelIndex:modelIndex]; |
| 1467 TabController* tabController = [tabArray_ objectAtIndex:index]; | 1467 TabController* tabController = [tabArray_ objectAtIndex:index]; |
| 1468 | 1468 |
| 1469 FaviconTabHelper* favicon_tab_helper = |
| 1470 FaviconTabHelper::FromWebContents(contents->web_contents()); |
| 1469 bool oldHasIcon = [tabController iconView] != nil; | 1471 bool oldHasIcon = [tabController iconView] != nil; |
| 1470 bool newHasIcon = contents->favicon_tab_helper()->ShouldDisplayFavicon() || | 1472 bool newHasIcon = favicon_tab_helper->ShouldDisplayFavicon() || |
| 1471 tabStripModel_->IsMiniTab(modelIndex); // Always show icon if mini. | 1473 tabStripModel_->IsMiniTab(modelIndex); // Always show icon if mini. |
| 1472 | 1474 |
| 1473 TabLoadingState oldState = [tabController loadingState]; | 1475 TabLoadingState oldState = [tabController loadingState]; |
| 1474 TabLoadingState newState = kTabDone; | 1476 TabLoadingState newState = kTabDone; |
| 1475 NSImage* throbberImage = nil; | 1477 NSImage* throbberImage = nil; |
| 1476 if (contents->web_contents()->IsCrashed()) { | 1478 if (contents->web_contents()->IsCrashed()) { |
| 1477 newState = kTabCrashed; | 1479 newState = kTabCrashed; |
| 1478 newHasIcon = true; | 1480 newHasIcon = true; |
| 1479 } else if (contents->web_contents()->IsWaitingForResponse()) { | 1481 } else if (contents->web_contents()->IsWaitingForResponse()) { |
| 1480 newState = kTabWaiting; | 1482 newState = kTabWaiting; |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2104 NSView* GetSheetParentViewForTabContents(TabContents* tab_contents) { | 2106 NSView* GetSheetParentViewForTabContents(TabContents* tab_contents) { |
| 2105 // View hierarchy of the contents view: | 2107 // View hierarchy of the contents view: |
| 2106 // NSView -- switchView, same for all tabs | 2108 // NSView -- switchView, same for all tabs |
| 2107 // +- NSView -- TabContentsController's view | 2109 // +- NSView -- TabContentsController's view |
| 2108 // +- TabContentsViewCocoa | 2110 // +- TabContentsViewCocoa |
| 2109 // | 2111 // |
| 2110 // Changing it? Do not forget to modify | 2112 // Changing it? Do not forget to modify |
| 2111 // -[TabStripController swapInTabAtIndex:] too. | 2113 // -[TabStripController swapInTabAtIndex:] too. |
| 2112 return [tab_contents->web_contents()->GetNativeView() superview]; | 2114 return [tab_contents->web_contents()->GetNativeView() superview]; |
| 2113 } | 2115 } |
| OLD | NEW |