| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "chrome/common/chrome_switches.h" | 49 #include "chrome/common/chrome_switches.h" |
| 50 #include "chrome/grit/generated_resources.h" | 50 #include "chrome/grit/generated_resources.h" |
| 51 #include "components/metrics/proto/omnibox_event.pb.h" | 51 #include "components/metrics/proto/omnibox_event.pb.h" |
| 52 #include "components/omnibox/browser/autocomplete_classifier.h" | 52 #include "components/omnibox/browser/autocomplete_classifier.h" |
| 53 #include "components/omnibox/browser/autocomplete_match.h" | 53 #include "components/omnibox/browser/autocomplete_match.h" |
| 54 #include "components/url_formatter/url_fixer.h" | 54 #include "components/url_formatter/url_fixer.h" |
| 55 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 55 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 56 #include "content/public/browser/navigation_controller.h" | 56 #include "content/public/browser/navigation_controller.h" |
| 57 #include "content/public/browser/user_metrics.h" | 57 #include "content/public/browser/user_metrics.h" |
| 58 #include "content/public/browser/web_contents.h" | 58 #include "content/public/browser/web_contents.h" |
| 59 #include "grit/components_scaled_resources.h" |
| 59 #include "grit/theme_resources.h" | 60 #include "grit/theme_resources.h" |
| 60 #include "skia/ext/skia_utils_mac.h" | 61 #include "skia/ext/skia_utils_mac.h" |
| 61 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h
" | 62 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h
" |
| 62 #include "ui/base/cocoa/animation_utils.h" | 63 #include "ui/base/cocoa/animation_utils.h" |
| 63 #import "ui/base/cocoa/tracking_area.h" | 64 #import "ui/base/cocoa/tracking_area.h" |
| 64 #include "ui/base/l10n/l10n_util.h" | 65 #include "ui/base/l10n/l10n_util.h" |
| 65 #include "ui/base/models/list_selection_model.h" | 66 #include "ui/base/models/list_selection_model.h" |
| 66 #include "ui/base/resource/resource_bundle.h" | 67 #include "ui/base/resource/resource_bundle.h" |
| 67 #include "ui/base/theme_provider.h" | 68 #include "ui/base/theme_provider.h" |
| 68 #include "ui/gfx/image/image.h" | 69 #include "ui/gfx/image/image.h" |
| (...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1571 if (!contents) | 1572 if (!contents) |
| 1572 return; | 1573 return; |
| 1573 | 1574 |
| 1574 static NSImage* throbberWaitingImage = | 1575 static NSImage* throbberWaitingImage = |
| 1575 ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 1576 ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
| 1576 IDR_THROBBER_WAITING).CopyNSImage(); | 1577 IDR_THROBBER_WAITING).CopyNSImage(); |
| 1577 static NSImage* throbberLoadingImage = | 1578 static NSImage* throbberLoadingImage = |
| 1578 ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 1579 ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
| 1579 IDR_THROBBER).CopyNSImage(); | 1580 IDR_THROBBER).CopyNSImage(); |
| 1580 static NSImage* sadFaviconImage = | 1581 static NSImage* sadFaviconImage = |
| 1581 ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 1582 ResourceBundle::GetSharedInstance() |
| 1582 IDR_SAD_FAVICON).CopyNSImage(); | 1583 .GetNativeImageNamed(IDR_CRASH_SAD_FAVICON) |
| 1584 .CopyNSImage(); |
| 1583 | 1585 |
| 1584 // Take closing tabs into account. | 1586 // Take closing tabs into account. |
| 1585 NSInteger index = [self indexFromModelIndex:modelIndex]; | 1587 NSInteger index = [self indexFromModelIndex:modelIndex]; |
| 1586 TabController* tabController = [tabArray_ objectAtIndex:index]; | 1588 TabController* tabController = [tabArray_ objectAtIndex:index]; |
| 1587 | 1589 |
| 1588 bool oldHasIcon = [tabController iconView] != nil; | 1590 bool oldHasIcon = [tabController iconView] != nil; |
| 1589 bool newHasIcon = | 1591 bool newHasIcon = |
| 1590 favicon::ShouldDisplayFavicon(contents) || | 1592 favicon::ShouldDisplayFavicon(contents) || |
| 1591 tabStripModel_->IsTabPinned(modelIndex); // Always show icon if pinned. | 1593 tabStripModel_->IsTabPinned(modelIndex); // Always show icon if pinned. |
| 1592 | 1594 |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2328 forButtonState:image_button_cell::kHoverStateBackground]; | 2330 forButtonState:image_button_cell::kHoverStateBackground]; |
| 2329 } else { | 2331 } else { |
| 2330 [[newTabButton_ cell] setImage:nil | 2332 [[newTabButton_ cell] setImage:nil |
| 2331 forButtonState:image_button_cell::kDefaultStateBackground]; | 2333 forButtonState:image_button_cell::kDefaultStateBackground]; |
| 2332 [[newTabButton_ cell] setImage:nil | 2334 [[newTabButton_ cell] setImage:nil |
| 2333 forButtonState:image_button_cell::kHoverStateBackground]; | 2335 forButtonState:image_button_cell::kHoverStateBackground]; |
| 2334 } | 2336 } |
| 2335 } | 2337 } |
| 2336 | 2338 |
| 2337 @end | 2339 @end |
| OLD | NEW |