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

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

Issue 3127008: Preliminary work on resuming downloads whose connections have expired.
Patch Set: Waiting to send download automation error message until after other downloads are canceled. Created 10 years, 3 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 public: 49 public:
50 DownloadItemView(DownloadItem* download, 50 DownloadItemView(DownloadItem* download,
51 DownloadShelfView* parent, 51 DownloadShelfView* parent,
52 BaseDownloadItemModel* model); 52 BaseDownloadItemModel* model);
53 virtual ~DownloadItemView(); 53 virtual ~DownloadItemView();
54 54
55 // DownloadObserver method 55 // DownloadObserver method
56 virtual void OnDownloadUpdated(DownloadItem* download); 56 virtual void OnDownloadUpdated(DownloadItem* download);
57 virtual void OnDownloadFileCompleted(DownloadItem* download) { } 57 virtual void OnDownloadFileCompleted(DownloadItem* download) { }
58 virtual void OnDownloadOpened(DownloadItem* download); 58 virtual void OnDownloadOpened(DownloadItem* download);
59 virtual void OnDownloadInterrupted(DownloadItem* download) { }
59 60
60 // View overrides 61 // View overrides
61 virtual void Layout(); 62 virtual void Layout();
62 virtual void Paint(gfx::Canvas* canvas); 63 virtual void Paint(gfx::Canvas* canvas);
63 virtual gfx::Size GetPreferredSize(); 64 virtual gfx::Size GetPreferredSize();
64 virtual void OnMouseExited(const views::MouseEvent& event); 65 virtual void OnMouseExited(const views::MouseEvent& event);
65 virtual void OnMouseMoved(const views::MouseEvent& event); 66 virtual void OnMouseMoved(const views::MouseEvent& event);
66 virtual bool OnMousePressed(const views::MouseEvent& event); 67 virtual bool OnMousePressed(const views::MouseEvent& event);
67 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); 68 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled);
68 virtual bool OnMouseDragged(const views::MouseEvent& event); 69 virtual bool OnMouseDragged(const views::MouseEvent& event);
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // This class owns the pointer. 221 // This class owns the pointer.
221 scoped_ptr<BaseDownloadItemModel> model_; 222 scoped_ptr<BaseDownloadItemModel> model_;
222 223
223 // Hover animations for our body and drop buttons. 224 // Hover animations for our body and drop buttons.
224 scoped_ptr<SlideAnimation> body_hover_animation_; 225 scoped_ptr<SlideAnimation> body_hover_animation_;
225 scoped_ptr<SlideAnimation> drop_hover_animation_; 226 scoped_ptr<SlideAnimation> drop_hover_animation_;
226 227
227 // Animation for download complete. 228 // Animation for download complete.
228 scoped_ptr<SlideAnimation> complete_animation_; 229 scoped_ptr<SlideAnimation> complete_animation_;
229 230
231 // Animation for download interrupted.
232 scoped_ptr<SlideAnimation> interrupted_animation_;
233
230 // Progress animation 234 // Progress animation
231 base::RepeatingTimer<DownloadItemView> progress_timer_; 235 base::RepeatingTimer<DownloadItemView> progress_timer_;
232 236
233 // Dangerous mode buttons. 237 // Dangerous mode buttons.
234 views::NativeButton* save_button_; 238 views::NativeButton* save_button_;
235 views::NativeButton* discard_button_; 239 views::NativeButton* discard_button_;
236 240
237 // Dangerous mode label. 241 // Dangerous mode label.
238 views::Label* dangerous_download_label_; 242 views::Label* dangerous_download_label_;
239 243
(...skipping 18 matching lines...) Expand all
258 262
259 // If non-NULL, set to true when this object is deleted. 263 // If non-NULL, set to true when this object is deleted.
260 // (Used when showing the context menu as it runs an inner message loop that 264 // (Used when showing the context menu as it runs an inner message loop that
261 // might delete us). 265 // might delete us).
262 bool* deleted_; 266 bool* deleted_;
263 267
264 DISALLOW_COPY_AND_ASSIGN(DownloadItemView); 268 DISALLOW_COPY_AND_ASSIGN(DownloadItemView);
265 }; 269 };
266 270
267 #endif // CHROME_BROWSER_VIEWS_DOWNLOAD_ITEM_VIEW_H__ 271 #endif // CHROME_BROWSER_VIEWS_DOWNLOAD_ITEM_VIEW_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698