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

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

Issue 12211049: Removing base::ThreadRestrictions::ScopedAllowIO from icon_manager_linux.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix presubmit. Created 7 years, 8 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
OLDNEW
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 #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/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/download/download_item_model.h" 10 #include "chrome/browser/download/download_item_model.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 void DownloadItemMac::LoadIcon() { 77 void DownloadItemMac::LoadIcon() {
78 IconManager* icon_manager = g_browser_process->icon_manager(); 78 IconManager* icon_manager = g_browser_process->icon_manager();
79 if (!icon_manager) { 79 if (!icon_manager) {
80 NOTREACHED(); 80 NOTREACHED();
81 return; 81 return;
82 } 82 }
83 83
84 // We may already have this particular image cached. 84 // We may already have this particular image cached.
85 base::FilePath file = download_model_.download()->GetUserVerifiedFilePath(); 85 base::FilePath file = download_model_.download()->GetUserVerifiedFilePath();
86 gfx::Image* icon = icon_manager->LookupIcon(file, IconLoader::ALL); 86 gfx::Image* icon = icon_manager->LookupIconFromFilepath(
87 file, IconLoader::ALL);
87 if (icon) { 88 if (icon) {
88 [item_controller_ setIcon:icon->ToNSImage()]; 89 [item_controller_ setIcon:icon->ToNSImage()];
89 return; 90 return;
90 } 91 }
91 92
92 // The icon isn't cached, load it asynchronously. 93 // The icon isn't cached, load it asynchronously.
93 icon_manager->LoadIcon(file, 94 icon_manager->LoadIcon(file,
94 IconLoader::ALL, 95 IconLoader::ALL,
95 base::Bind(&DownloadItemMac::OnExtractIconComplete, 96 base::Bind(&DownloadItemMac::OnExtractIconComplete,
96 base::Unretained(this)), 97 base::Unretained(this)),
97 &cancelable_task_tracker_); 98 &cancelable_task_tracker_);
98 } 99 }
99 100
100 void DownloadItemMac::OnExtractIconComplete(gfx::Image* icon) { 101 void DownloadItemMac::OnExtractIconComplete(gfx::Image* icon) {
101 if (!icon) 102 if (!icon)
102 return; 103 return;
103 [item_controller_ setIcon:icon->ToNSImage()]; 104 [item_controller_ setIcon:icon->ToNSImage()];
104 } 105 }
OLDNEW
« no previous file with comments | « chrome/browser/icon_manager_win.cc ('k') | chrome/browser/ui/views/download/download_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698