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

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

Issue 7277073: Support for adding save page download items into downloads history. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/download/download_item.h" 5 #include "chrome/browser/download/download_item.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/i18n/case_conversion.h" 10 #include "base/i18n/case_conversion.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 opened_(false), 186 opened_(false),
187 open_enabled_(true) { 187 open_enabled_(true) {
188 Init(true /* actively downloading */); 188 Init(true /* actively downloading */);
189 } 189 }
190 190
191 // Constructing for the "Save Page As..." feature: 191 // Constructing for the "Save Page As..." feature:
192 DownloadItem::DownloadItem(DownloadManager* download_manager, 192 DownloadItem::DownloadItem(DownloadManager* download_manager,
193 const FilePath& path, 193 const FilePath& path,
194 const GURL& url, 194 const GURL& url,
195 bool is_otr) 195 bool is_otr)
196 : download_id_(1), 196 : download_id_(download_manager->GetNextSavePageId()),
197 full_path_(path), 197 full_path_(path),
198 url_chain_(1, url), 198 url_chain_(1, url),
199 referrer_url_(GURL()), 199 referrer_url_(GURL()),
200 total_bytes_(0), 200 total_bytes_(0),
201 received_bytes_(0), 201 received_bytes_(0),
202 last_os_error_(0), 202 last_os_error_(0),
203 start_tick_(base::TimeTicks::Now()), 203 start_tick_(base::TimeTicks::Now()),
204 state_(IN_PROGRESS), 204 state_(IN_PROGRESS),
205 start_time_(base::Time::Now()), 205 start_time_(base::Time::Now()),
206 db_handle_(DownloadHistory::kUninitializedHandle), 206 db_handle_(DownloadHistory::kUninitializedHandle),
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 state_info_.target_name.value().c_str(), 858 state_info_.target_name.value().c_str(),
859 full_path().value().c_str()); 859 full_path().value().c_str());
860 } else { 860 } else {
861 description += base::StringPrintf(" url = \"%s\"", url_list.c_str()); 861 description += base::StringPrintf(" url = \"%s\"", url_list.c_str());
862 } 862 }
863 863
864 description += " }"; 864 description += " }";
865 865
866 return description; 866 return description;
867 } 867 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698