Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(977)

Unified Diff: chrome/browser/ui/cocoa/tab_contents/favicon_util_mac.mm

Issue 2321833002: [Mac] Desaturate the Favicon for Network Errors (Closed)
Patch Set: Fix for Views Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/tab_contents/favicon_util_mac.mm
diff --git a/chrome/browser/ui/cocoa/tab_contents/favicon_util_mac.mm b/chrome/browser/ui/cocoa/tab_contents/favicon_util_mac.mm
index 348cf20030e259e4998c894867f326f02ab4ebf3..717398d72189ff79fbc77625c9f53e612da0b7ab 100644
--- a/chrome/browser/ui/cocoa/tab_contents/favicon_util_mac.mm
+++ b/chrome/browser/ui/cocoa/tab_contents/favicon_util_mac.mm
@@ -7,7 +7,7 @@
#import <Cocoa/Cocoa.h>
#include "base/mac/scoped_nsobject.h"
-#include "components/favicon/content/content_favicon_driver.h"
+#include "chrome/browser/favicon/favicon_utils.h"
#include "skia/ext/skia_utils_mac.h"
#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
@@ -25,16 +25,13 @@ const CGFloat kVectorIconSize = 16;
namespace mac {
NSImage* FaviconForWebContents(content::WebContents* contents, SkColor color) {
- favicon::FaviconDriver* favicon_driver =
- contents ? favicon::ContentFaviconDriver::FromWebContents(contents)
- : nullptr;
- if (favicon_driver && favicon_driver->FaviconIsValid()) {
- NSImage* image = favicon_driver->GetFavicon().AsNSImage();
+ if (contents) {
+ NSImage* image = favicon::TabFaviconFromWebContents(contents).AsNSImage();
+
// The |image| could be nil if the bitmap is null. In that case, fallback
// to the default image.
- if (image) {
+ if (image)
return image;
- }
}
if (ui::MaterialDesignController::IsModeMaterial()) {
« no previous file with comments | « chrome/browser/favicon/favicon_utils.cc ('k') | chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698