| 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 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1498 BOOL isApp = extensions_tab_helper->is_app(); | 1498 BOOL isApp = extensions_tab_helper->is_app(); |
| 1499 NSImage* image = nil; | 1499 NSImage* image = nil; |
| 1500 // Favicons come from the renderer, and the renderer draws everything in the | 1500 // Favicons come from the renderer, and the renderer draws everything in the |
| 1501 // system color space. | 1501 // system color space. |
| 1502 CGColorSpaceRef colorSpace = base::mac::GetSystemColorSpace(); | 1502 CGColorSpaceRef colorSpace = base::mac::GetSystemColorSpace(); |
| 1503 if (isApp) { | 1503 if (isApp) { |
| 1504 SkBitmap* icon = extensions_tab_helper->GetExtensionAppIcon(); | 1504 SkBitmap* icon = extensions_tab_helper->GetExtensionAppIcon(); |
| 1505 if (icon) | 1505 if (icon) |
| 1506 image = skia::SkBitmapToNSImageWithColorSpace(*icon, colorSpace); | 1506 image = skia::SkBitmapToNSImageWithColorSpace(*icon, colorSpace); |
| 1507 } else { | 1507 } else { |
| 1508 image = mac::FaviconForWebContents(contents); | 1508 TabController* tab = [tabArray_ firstObject]; |
| 1509 NSColor* titleColor = [[tab tabView] titleColor]; |
| 1510 NSColor* deviceColor = |
| 1511 [titleColor colorUsingColorSpace:[NSColorSpace deviceRGBColorSpace]]; |
| 1512 image = mac::FaviconForWebContents( |
| 1513 contents, skia::NSDeviceColorToSkColor(deviceColor)); |
| 1509 } | 1514 } |
| 1510 | 1515 |
| 1511 // Either we don't have a valid favicon or there was some issue converting it | 1516 // Either we don't have a valid favicon or there was some issue converting it |
| 1512 // from an SkBitmap. Either way, just show the default. | 1517 // from an SkBitmap. Either way, just show the default. |
| 1513 if (!image) | 1518 if (!image) |
| 1514 image = defaultFavicon_.get(); | 1519 image = defaultFavicon_.get(); |
| 1515 | 1520 |
| 1516 return image; | 1521 return image; |
| 1517 } | 1522 } |
| 1518 | 1523 |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2300 | 2305 |
| 2301 - (TabAlertState)alertStateForContents:(content::WebContents*)contents { | 2306 - (TabAlertState)alertStateForContents:(content::WebContents*)contents { |
| 2302 return chrome::GetTabAlertStateForContents(contents); | 2307 return chrome::GetTabAlertStateForContents(contents); |
| 2303 } | 2308 } |
| 2304 | 2309 |
| 2305 - (void)themeDidChangeNotification:(NSNotification*)notification { | 2310 - (void)themeDidChangeNotification:(NSNotification*)notification { |
| 2306 [newTabButton_ setImages]; | 2311 [newTabButton_ setImages]; |
| 2307 } | 2312 } |
| 2308 | 2313 |
| 2309 @end | 2314 @end |
| OLD | NEW |