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

Side by Side Diff: chrome/browser/ui/cocoa/download/download_item_mac.mm

Issue 6995068: Mac: Fix icons in download dom UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linux build Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/icon_loader_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/ui/cocoa/download/download_item_mac.h" 5 #include "chrome/browser/ui/cocoa/download/download_item_mac.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/download/download_item.h" 9 #include "chrome/browser/download/download_item.h"
10 #include "chrome/browser/download/download_item_model.h" 10 #include "chrome/browser/download/download_item_model.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 void DownloadItemMac::LoadIcon() { 73 void DownloadItemMac::LoadIcon() {
74 IconManager* icon_manager = g_browser_process->icon_manager(); 74 IconManager* icon_manager = g_browser_process->icon_manager();
75 if (!icon_manager) { 75 if (!icon_manager) {
76 NOTREACHED(); 76 NOTREACHED();
77 return; 77 return;
78 } 78 }
79 79
80 // We may already have this particular image cached. 80 // We may already have this particular image cached.
81 FilePath file = download_model_->download()->GetUserVerifiedFilePath(); 81 FilePath file = download_model_->download()->GetUserVerifiedFilePath();
82 gfx::Image* icon = icon_manager->LookupIcon(file, IconLoader::SMALL); 82 gfx::Image* icon = icon_manager->LookupIcon(file, IconLoader::ALL);
83 if (icon) { 83 if (icon) {
84 [item_controller_ setIcon:*icon]; 84 [item_controller_ setIcon:*icon];
85 return; 85 return;
86 } 86 }
87 87
88 // The icon isn't cached, load it asynchronously. 88 // The icon isn't cached, load it asynchronously.
89 icon_manager->LoadIcon(file, IconLoader::SMALL, &icon_consumer_, 89 icon_manager->LoadIcon(file, IconLoader::ALL, &icon_consumer_,
90 NewCallback(this, 90 NewCallback(this,
91 &DownloadItemMac::OnExtractIconComplete)); 91 &DownloadItemMac::OnExtractIconComplete));
92 } 92 }
93 93
94 void DownloadItemMac::OnExtractIconComplete(IconManager::Handle handle, 94 void DownloadItemMac::OnExtractIconComplete(IconManager::Handle handle,
95 gfx::Image* icon) { 95 gfx::Image* icon) {
96 if (!icon) 96 if (!icon)
97 return; 97 return;
98 [item_controller_ setIcon:*icon]; 98 [item_controller_ setIcon:*icon];
99 } 99 }
OLDNEW
« no previous file with comments | « chrome/browser/icon_loader_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698