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

Unified Diff: chrome/browser/ui/gtk/download/download_item_gtk.cc

Issue 11441006: Convert IconManager to use new CancelableTaskTracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and fix mac compiling Created 8 years 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/gtk/download/download_item_gtk.cc
diff --git a/chrome/browser/ui/gtk/download/download_item_gtk.cc b/chrome/browser/ui/gtk/download/download_item_gtk.cc
index 2c7bc55245ebf73cf9ec9bffd35189265d0e5339..c2d5ad3898b088434eaa78e5426a13a5770a3165 100644
--- a/chrome/browser/ui/gtk/download/download_item_gtk.cc
+++ b/chrome/browser/ui/gtk/download/download_item_gtk.cc
@@ -283,7 +283,6 @@ DownloadItemGtk::~DownloadItemGtk() {
if (menu_.get())
menu_.reset();
- icon_consumer_.CancelAllRequests();
StopDownloadProgress();
get_download()->RemoveObserver(this);
@@ -452,30 +451,30 @@ void DownloadItemGtk::StopDownloadProgress() {
// Icon loading functions.
-void DownloadItemGtk::OnLoadSmallIconComplete(IconManager::Handle handle,
- gfx::Image* image) {
+void DownloadItemGtk::OnLoadSmallIconComplete(gfx::Image* image) {
icon_small_ = image;
gtk_widget_queue_draw(progress_area_.get());
}
-void DownloadItemGtk::OnLoadLargeIconComplete(IconManager::Handle handle,
- gfx::Image* image) {
+void DownloadItemGtk::OnLoadLargeIconComplete(gfx::Image* image) {
icon_large_ = image;
DownloadItemDrag::SetSource(body_.get(), get_download(), icon_large_);
}
void DownloadItemGtk::LoadIcon() {
- icon_consumer_.CancelAllRequests();
+ cancelable_task_tracker_.TryCancelAll();
IconManager* im = g_browser_process->icon_manager();
icon_filepath_ = get_download()->GetUserVerifiedFilePath();
im->LoadIcon(icon_filepath_,
- IconLoader::SMALL, &icon_consumer_,
+ IconLoader::SMALL,
base::Bind(&DownloadItemGtk::OnLoadSmallIconComplete,
- base::Unretained(this)));
+ base::Unretained(this)),
+ &cancelable_task_tracker_);
im->LoadIcon(icon_filepath_,
- IconLoader::LARGE, &icon_consumer_,
+ IconLoader::LARGE,
base::Bind(&DownloadItemGtk::OnLoadLargeIconComplete,
- base::Unretained(this)));
+ base::Unretained(this)),
+ &cancelable_task_tracker_);
}
void DownloadItemGtk::UpdateTooltip() {
« no previous file with comments | « chrome/browser/ui/gtk/download/download_item_gtk.h ('k') | chrome/browser/ui/views/download/download_item_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698