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

Side by Side Diff: chrome/browser/ui/views/download/download_item_view.h

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 unified diff | Download patch | Annotate | Revision Log
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 // A ChromeView that implements one download on the Download shelf. 5 // A ChromeView that implements one download on the Download shelf.
6 // Each DownloadItemView contains an application icon, a text label 6 // Each DownloadItemView contains an application icon, a text label
7 // indicating the download's file name, a text label indicating the 7 // indicating the download's file name, a text label indicating the
8 // download's status (such as the number of bytes downloaded so far) 8 // download's status (such as the number of bytes downloaded so far)
9 // and a button for canceling an in progress download, or opening 9 // and a button for canceling an in progress download, or opening
10 // the completed download. 10 // the completed download.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 DownloadShelfView* parent, 62 DownloadShelfView* parent,
63 DownloadItemModel* model); 63 DownloadItemModel* model);
64 virtual ~DownloadItemView(); 64 virtual ~DownloadItemView();
65 65
66 // Timer callback for handling animations 66 // Timer callback for handling animations
67 void UpdateDownloadProgress(); 67 void UpdateDownloadProgress();
68 void StartDownloadProgress(); 68 void StartDownloadProgress();
69 void StopDownloadProgress(); 69 void StopDownloadProgress();
70 70
71 // IconManager::Client interface. 71 // IconManager::Client interface.
72 void OnExtractIconComplete(IconManager::Handle handle, gfx::Image* icon); 72 void OnExtractIconComplete(gfx::Image* icon);
73 73
74 // Returns the DownloadItem model object belonging to this item. 74 // Returns the DownloadItem model object belonging to this item.
75 content::DownloadItem* download() const { return download_; } 75 content::DownloadItem* download() const { return download_; }
76 76
77 // DownloadItem::Observer methods 77 // DownloadItem::Observer methods
78 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; 78 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE;
79 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE; 79 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE;
80 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; 80 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE;
81 81
82 // Overridden from views::View: 82 // Overridden from views::View:
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 // Whether we are dragging the download button. 274 // Whether we are dragging the download button.
275 bool dragging_; 275 bool dragging_;
276 276
277 // Whether we are tracking a possible drag. 277 // Whether we are tracking a possible drag.
278 bool starting_drag_; 278 bool starting_drag_;
279 279
280 // Position that a possible drag started at. 280 // Position that a possible drag started at.
281 gfx::Point drag_start_point_; 281 gfx::Point drag_start_point_;
282 282
283 // For canceling an in progress icon request. 283 // For canceling an in progress icon request.
284 CancelableRequestConsumerT<int, 0> icon_consumer_; 284 CancelableTaskTracker cancelable_task_tracker_;
285 285
286 // A model class to control the status text we display and the cancel 286 // A model class to control the status text we display and the cancel
287 // behavior. 287 // behavior.
288 // This class owns the pointer. 288 // This class owns the pointer.
289 scoped_ptr<DownloadItemModel> model_; 289 scoped_ptr<DownloadItemModel> model_;
290 290
291 // Hover animations for our body and drop buttons. 291 // Hover animations for our body and drop buttons.
292 scoped_ptr<ui::SlideAnimation> body_hover_animation_; 292 scoped_ptr<ui::SlideAnimation> body_hover_animation_;
293 scoped_ptr<ui::SlideAnimation> drop_hover_animation_; 293 scoped_ptr<ui::SlideAnimation> drop_hover_animation_;
294 294
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 329
330 // The icon loaded in the download shelf is based on the file path of the 330 // The icon loaded in the download shelf is based on the file path of the
331 // item. Store the path used, so that we can detect a change in the path 331 // item. Store the path used, so that we can detect a change in the path
332 // and reload the icon. 332 // and reload the icon.
333 FilePath last_download_item_path_; 333 FilePath last_download_item_path_;
334 334
335 DISALLOW_COPY_AND_ASSIGN(DownloadItemView); 335 DISALLOW_COPY_AND_ASSIGN(DownloadItemView);
336 }; 336 };
337 337
338 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_ITEM_VIEW_H__ 338 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_ITEM_VIEW_H__
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/download/download_item_gtk.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