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

Side by Side Diff: chrome/browser/download/download_item.h

Issue 2877008: Rename the download to its final name only after the download is finished (Closed)
Patch Set: rebase Created 10 years, 5 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 // Each download is represented by a DownloadItem, and all DownloadItems 5 // Each download is represented by a DownloadItem, and all DownloadItems
6 // are owned by the DownloadManager which maintains a global list of all 6 // are owned by the DownloadManager which maintains a global list of all
7 // downloads. DownloadItems are created when a user initiates a download, 7 // downloads. DownloadItems are created when a user initiates a download,
8 // and exist for the duration of the browser life time. 8 // and exist for the duration of the browser life time.
9 // 9 //
10 // Download observers: 10 // Download observers:
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 void set_original_name(const FilePath& name) { original_name_ = name; } 185 void set_original_name(const FilePath& name) { original_name_ = name; }
186 bool save_as() const { return save_as_; } 186 bool save_as() const { return save_as_; }
187 bool is_otr() const { return is_otr_; } 187 bool is_otr() const { return is_otr_; }
188 bool is_extension_install() const { return is_extension_install_; } 188 bool is_extension_install() const { return is_extension_install_; }
189 bool name_finalized() const { return name_finalized_; } 189 bool name_finalized() const { return name_finalized_; }
190 void set_name_finalized(bool name_finalized) { 190 void set_name_finalized(bool name_finalized) {
191 name_finalized_ = name_finalized; 191 name_finalized_ = name_finalized;
192 } 192 }
193 bool is_temporary() const { return is_temporary_; } 193 bool is_temporary() const { return is_temporary_; }
194 void set_is_temporary(bool is_temporary) { is_temporary_ = is_temporary; } 194 void set_is_temporary(bool is_temporary) { is_temporary_ = is_temporary; }
195 bool need_final_rename() const { return need_final_rename_; }
196 void set_need_final_rename(bool need_final_rename) {
197 need_final_rename_ = need_final_rename;
198 }
195 199
196 // Returns the file-name that should be reported to the user, which is 200 // Returns the file-name that should be reported to the user, which is
197 // file_name_ for safe downloads and original_name_ for dangerous ones with 201 // file_name_ for safe downloads and original_name_ for dangerous ones with
198 // the uniquifier number. 202 // the uniquifier number.
199 FilePath GetFileName() const; 203 FilePath GetFileName() const;
200 204
201 private: 205 private:
202 // Internal helper for maintaining consistent received and total sizes. 206 // Internal helper for maintaining consistent received and total sizes.
203 void UpdateSize(int64 size); 207 void UpdateSize(int64 size);
204 208
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 290
287 // True if the item was downloaded for an extension installation. 291 // True if the item was downloaded for an extension installation.
288 bool is_extension_install_; 292 bool is_extension_install_;
289 293
290 // True if the filename is finalized. 294 // True if the filename is finalized.
291 bool name_finalized_; 295 bool name_finalized_;
292 296
293 // True if the item was downloaded temporarily. 297 // True if the item was downloaded temporarily.
294 bool is_temporary_; 298 bool is_temporary_;
295 299
300 // True if the file needs final rename.
301 bool need_final_rename_;
302
296 DISALLOW_COPY_AND_ASSIGN(DownloadItem); 303 DISALLOW_COPY_AND_ASSIGN(DownloadItem);
297 }; 304 };
298 305
299 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ 306 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/download_file_manager.cc ('k') | chrome/browser/download/download_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698