| Index: content/browser/download/download_item.cc
|
| diff --git a/content/browser/download/download_item.cc b/content/browser/download/download_item.cc
|
| index 0913569c471811ff89a5d92c50d3cb9b2132f8cf..8c2afc8f4f06b105ffd6200b43370bc321da489b 100644
|
| --- a/content/browser/download/download_item.cc
|
| +++ b/content/browser/download/download_item.cc
|
| @@ -157,7 +157,7 @@ DownloadItem::DownloadItem(DownloadManager* download_manager,
|
| // Constructing for a regular download:
|
| DownloadItem::DownloadItem(DownloadManager* download_manager,
|
| const DownloadCreateInfo& info,
|
| - const DownloadRequestHandle& request_handle,
|
| + DownloadRequestHandleInterface* request_handle,
|
| bool is_otr)
|
| : state_info_(info.original_name, info.save_info.file_path,
|
| info.has_user_gesture, info.transition_type,
|
| @@ -575,9 +575,9 @@ void DownloadItem::TogglePause() {
|
|
|
| DCHECK(IsInProgress());
|
| if (is_paused_)
|
| - request_handle_.ResumeRequest();
|
| + request_handle_->ResumeRequest();
|
| else
|
| - request_handle_.PauseRequest();
|
| + request_handle_->PauseRequest();
|
| is_paused_ = !is_paused_;
|
| UpdateObservers();
|
| }
|
| @@ -642,7 +642,7 @@ bool DownloadItem::MatchesQuery(const string16& query) const {
|
| // L"/\x4f60\x597d\x4f60\x597d",
|
| // "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD"
|
| std::string languages;
|
| - TabContents* tab = request_handle_.GetTabContents();
|
| + TabContents* tab = request_handle_->GetTabContents();
|
| if (tab)
|
| languages = content::GetContentClient()->browser()->GetAcceptLangs(tab);
|
| string16 url_formatted(net::FormatUrl(GetURL(), languages));
|
| @@ -702,6 +702,12 @@ DownloadPersistentStoreInfo DownloadItem::GetPersistentStoreInfo() const {
|
| opened());
|
| }
|
|
|
| +TabContents* DownloadItem::GetTabContents() const {
|
| + if (request_handle_.get())
|
| + return request_handle_->GetTabContents();
|
| + return NULL;
|
| +}
|
| +
|
| FilePath DownloadItem::GetTargetFilePath() const {
|
| return full_path_.DirName().Append(state_info_.target_name);
|
| }
|
| @@ -722,7 +728,7 @@ FilePath DownloadItem::GetUserVerifiedFilePath() const {
|
|
|
| void DownloadItem::OffThreadCancel(DownloadFileManager* file_manager) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| - request_handle_.CancelRequest();
|
| + request_handle_->CancelRequest();
|
|
|
| BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
|
| base::Bind(&DownloadFileManager::CancelDownload,
|
|
|