OLD | NEW |
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 <cmath> | 9 #include <cmath> |
10 #include <limits> | 10 #include <limits> |
(...skipping 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1415 NSInteger index = [self indexFromModelIndex:modelIndex]; | 1415 NSInteger index = [self indexFromModelIndex:modelIndex]; |
1416 TabController* tabController = [tabArray_ objectAtIndex:index]; | 1416 TabController* tabController = [tabArray_ objectAtIndex:index]; |
1417 | 1417 |
1418 bool oldHasIcon = [tabController iconView] != nil; | 1418 bool oldHasIcon = [tabController iconView] != nil; |
1419 bool newHasIcon = contents->favicon_tab_helper()->ShouldDisplayFavicon() || | 1419 bool newHasIcon = contents->favicon_tab_helper()->ShouldDisplayFavicon() || |
1420 tabStripModel_->IsMiniTab(modelIndex); // Always show icon if mini. | 1420 tabStripModel_->IsMiniTab(modelIndex); // Always show icon if mini. |
1421 | 1421 |
1422 TabLoadingState oldState = [tabController loadingState]; | 1422 TabLoadingState oldState = [tabController loadingState]; |
1423 TabLoadingState newState = kTabDone; | 1423 TabLoadingState newState = kTabDone; |
1424 NSImage* throbberImage = nil; | 1424 NSImage* throbberImage = nil; |
1425 if (contents->tab_contents()->is_crashed()) { | 1425 if (contents->tab_contents()->IsCrashed()) { |
1426 newState = kTabCrashed; | 1426 newState = kTabCrashed; |
1427 newHasIcon = true; | 1427 newHasIcon = true; |
1428 } else if (contents->tab_contents()->waiting_for_response()) { | 1428 } else if (contents->tab_contents()->IsWaitingForResponse()) { |
1429 newState = kTabWaiting; | 1429 newState = kTabWaiting; |
1430 throbberImage = throbberWaitingImage; | 1430 throbberImage = throbberWaitingImage; |
1431 } else if (contents->tab_contents()->IsLoading()) { | 1431 } else if (contents->tab_contents()->IsLoading()) { |
1432 newState = kTabLoading; | 1432 newState = kTabLoading; |
1433 throbberImage = throbberLoadingImage; | 1433 throbberImage = throbberLoadingImage; |
1434 } | 1434 } |
1435 | 1435 |
1436 if (oldState != newState) | 1436 if (oldState != newState) |
1437 [tabController setLoadingState:newState]; | 1437 [tabController setLoadingState:newState]; |
1438 | 1438 |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2088 NSInteger index = [self indexFromModelIndex:modelIndex]; | 2088 NSInteger index = [self indexFromModelIndex:modelIndex]; |
2089 BrowserWindowController* controller = | 2089 BrowserWindowController* controller = |
2090 (BrowserWindowController*)[[switchView_ window] windowController]; | 2090 (BrowserWindowController*)[[switchView_ window] windowController]; |
2091 DCHECK(index >= 0); | 2091 DCHECK(index >= 0); |
2092 if (index >= 0) { | 2092 if (index >= 0) { |
2093 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; | 2093 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; |
2094 } | 2094 } |
2095 } | 2095 } |
2096 | 2096 |
2097 @end | 2097 @end |
OLD | NEW |