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

Unified Diff: chrome/browser/ui/cocoa/history_menu_bridge.mm

Issue 6651014: Applied the IconType. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: sync Created 9 years, 9 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/history_menu_bridge.mm
diff --git a/chrome/browser/ui/cocoa/history_menu_bridge.mm b/chrome/browser/ui/cocoa/history_menu_bridge.mm
index 7778a345b86d9fc35e0d8a9a2561ae7ce21f0ee0..c1ff61f94adeaf7d6223ca8a459fc72227a638c3 100644
--- a/chrome/browser/ui/cocoa/history_menu_bridge.mm
+++ b/chrome/browser/ui/cocoa/history_menu_bridge.mm
@@ -422,7 +422,7 @@ void HistoryMenuBridge::GetFaviconForHistoryItem(HistoryItem* item) {
FaviconService* service =
profile_->GetFaviconService(Profile::EXPLICIT_ACCESS);
FaviconService::Handle handle = service->GetFaviconForURL(item->url,
- &favicon_consumer_,
+ history::FAVICON, &favicon_consumer_,
NewCallback(this, &HistoryMenuBridge::GotFaviconData));
favicon_consumer_.SetClientData(service, handle, item);
item->icon_handle = handle;
@@ -430,10 +430,7 @@ void HistoryMenuBridge::GetFaviconForHistoryItem(HistoryItem* item) {
}
void HistoryMenuBridge::GotFaviconData(FaviconService::Handle handle,
- bool know_favicon,
- scoped_refptr<RefCountedMemory> data,
- bool expired,
- GURL url) {
+ history::FaviconData favicon) {
// Since we're going to do Cocoa-y things, make sure this is the main thread.
DCHECK([NSThread isMainThread]);
@@ -447,8 +444,9 @@ void HistoryMenuBridge::GotFaviconData(FaviconService::Handle handle,
// Convert the raw data to Skia and then to a NSImage.
// TODO(rsesek): Is there an easier way to do this?
SkBitmap icon;
- if (know_favicon && data.get() && data->size() &&
- gfx::PNGCodec::Decode(data->front(), data->size(), &icon)) {
+ if (favicon.is_valid() &&
+ gfx::PNGCodec::Decode(favicon.image_data->front(),
+ favicon.image_data->size(), &icon)) {
NSImage* image = gfx::SkBitmapToNSImage(icon);
if (image) {
// The conversion was successful.

Powered by Google App Engine
This is Rietveld 408576698