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

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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 opened_(false), 185 opened_(false),
186 open_enabled_(true) { 186 open_enabled_(true) {
187 Init(true /* actively downloading */); 187 Init(true /* actively downloading */);
188 } 188 }
189 189
190 // Constructing for the "Save Page As..." feature: 190 // Constructing for the "Save Page As..." feature:
191 DownloadItem::DownloadItem(DownloadManager* download_manager, 191 DownloadItem::DownloadItem(DownloadManager* download_manager,
192 const FilePath& path, 192 const FilePath& path,
193 const GURL& url, 193 const GURL& url,
194 bool is_otr) 194 bool is_otr)
195 : download_id_(1), 195 : download_id_(download_manager->GetNextSavePageId()),
196 full_path_(path), 196 full_path_(path),
197 url_chain_(1, url), 197 url_chain_(1, url),
198 referrer_url_(GURL()), 198 referrer_url_(GURL()),
199 total_bytes_(0), 199 total_bytes_(0),
200 received_bytes_(0), 200 received_bytes_(0),
201 last_os_error_(0), 201 last_os_error_(0),
202 start_tick_(base::TimeTicks::Now()), 202 start_tick_(base::TimeTicks::Now()),
203 state_(IN_PROGRESS), 203 state_(IN_PROGRESS),
204 start_time_(base::Time::Now()), 204 start_time_(base::Time::Now()),
205 db_handle_(DownloadHistory::kUninitializedHandle), 205 db_handle_(DownloadHistory::kUninitializedHandle),
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 state_info_.target_name.value().c_str(), 857 state_info_.target_name.value().c_str(),
858 full_path().value().c_str()); 858 full_path().value().c_str());
859 } else { 859 } else {
860 description += base::StringPrintf(" url = \"%s\"", url_list.c_str()); 860 description += base::StringPrintf(" url = \"%s\"", url_list.c_str());
861 } 861 }
862 862
863 description += " }"; 863 description += " }";
864 864
865 return description; 865 return description;
866 } 866 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/download_manager.h » ('j') | chrome/browser/download/download_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698