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

Side by Side Diff: content/browser/download/drag_download_file.cc

Issue 1977623002: Updates to DownloadUrlParameters in preparation for OOPIF changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 7 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/download/drag_download_file.h" 5 #include "content/browser/download/drag_download_file.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 void InitiateDownload(base::File file, 61 void InitiateDownload(base::File file,
62 const base::FilePath& file_path) { 62 const base::FilePath& file_path) {
63 DCHECK_CURRENTLY_ON(BrowserThread::UI); 63 DCHECK_CURRENTLY_ON(BrowserThread::UI);
64 DownloadManager* download_manager = 64 DownloadManager* download_manager =
65 BrowserContext::GetDownloadManager(web_contents_->GetBrowserContext()); 65 BrowserContext::GetDownloadManager(web_contents_->GetBrowserContext());
66 66
67 RecordDownloadSource(INITIATED_BY_DRAG_N_DROP); 67 RecordDownloadSource(INITIATED_BY_DRAG_N_DROP);
68 std::unique_ptr<content::DownloadUrlParameters> params( 68 std::unique_ptr<content::DownloadUrlParameters> params(
69 DownloadUrlParameters::FromWebContents(web_contents_, url_)); 69 DownloadUrlParameters::CreateForWebContentsMainFrame(
asanka 2016/05/13 20:53:41 This one is also fishy.
brettw 2016/05/13 21:20:57 I thought about this one. I was thinking this was
asanka 2016/05/18 15:26:37 Yeah. This is HTML5 drag & drop. See the "dragging
70 web_contents_, url_));
70 params->set_referrer(referrer_); 71 params->set_referrer(referrer_);
71 params->set_referrer_encoding(referrer_encoding_); 72 params->set_referrer_encoding(referrer_encoding_);
72 params->set_callback(base::Bind(&DragDownloadFileUI::OnDownloadStarted, 73 params->set_callback(base::Bind(&DragDownloadFileUI::OnDownloadStarted,
73 weak_ptr_factory_.GetWeakPtr())); 74 weak_ptr_factory_.GetWeakPtr()));
74 params->set_file_path(file_path); 75 params->set_file_path(file_path);
75 params->set_file(std::move(file)); // Nulls file. 76 params->set_file(std::move(file)); // Nulls file.
76 download_manager->DownloadUrl(std::move(params)); 77 download_manager->DownloadUrl(std::move(params));
77 } 78 }
78 79
79 void Cancel() { 80 void Cancel() {
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 242
242 void DragDownloadFile::CheckThread() { 243 void DragDownloadFile::CheckThread() {
243 #if defined(OS_WIN) 244 #if defined(OS_WIN)
244 DCHECK(drag_message_loop_ == base::MessageLoop::current()); 245 DCHECK(drag_message_loop_ == base::MessageLoop::current());
245 #else 246 #else
246 DCHECK_CURRENTLY_ON(BrowserThread::UI); 247 DCHECK_CURRENTLY_ON(BrowserThread::UI);
247 #endif 248 #endif
248 } 249 }
249 250
250 } // namespace content 251 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_item_impl.cc ('k') | content/browser/indexed_db/indexed_db_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698