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

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

Issue 21355004: [Downloads] Move client guid for AV scanning of downloaded files to chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Correct parsing Created 7 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) 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/download_manager_impl.h" 5 #include "content/browser/download/download_manager_impl.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 411 }
412 412
413 // Create the download file and start the download. 413 // Create the download file and start the download.
414 scoped_ptr<DownloadFile> download_file( 414 scoped_ptr<DownloadFile> download_file(
415 file_factory_->CreateFile( 415 file_factory_->CreateFile(
416 info->save_info.Pass(), default_download_directory, 416 info->save_info.Pass(), default_download_directory,
417 info->url(), info->referrer_url, 417 info->url(), info->referrer_url,
418 delegate_->GenerateFileHash(), 418 delegate_->GenerateFileHash(),
419 stream.Pass(), download->GetBoundNetLog(), 419 stream.Pass(), download->GetBoundNetLog(),
420 download->DestinationObserverAsWeakPtr())); 420 download->DestinationObserverAsWeakPtr()));
421
422 // Attach the client ID identifying the app to the AV system.
423 if (download_file.get() && delegate_) {
424 download_file->SetClientGuid(
425 delegate_->ApplicationClientIdForFileScanning());
426 }
427
421 scoped_ptr<DownloadRequestHandleInterface> req_handle( 428 scoped_ptr<DownloadRequestHandleInterface> req_handle(
422 new DownloadRequestHandle(info->request_handle)); 429 new DownloadRequestHandle(info->request_handle));
423 download->Start(download_file.Pass(), req_handle.Pass()); 430 download->Start(download_file.Pass(), req_handle.Pass());
424 431
425 // For interrupted downloads, Start() will transition the state to 432 // For interrupted downloads, Start() will transition the state to
426 // IN_PROGRESS and consumers will be notified via OnDownloadUpdated(). 433 // IN_PROGRESS and consumers will be notified via OnDownloadUpdated().
427 // For new downloads, we notify here, rather than earlier, so that 434 // For new downloads, we notify here, rather than earlier, so that
428 // the download_file is bound to download and all the usual 435 // the download_file is bound to download and all the usual
429 // setters (e.g. Cancel) work. 436 // setters (e.g. Cancel) work.
430 if (new_download) 437 if (new_download)
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 if (delegate_) 690 if (delegate_)
684 delegate_->OpenDownload(download); 691 delegate_->OpenDownload(download);
685 } 692 }
686 693
687 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { 694 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) {
688 if (delegate_) 695 if (delegate_)
689 delegate_->ShowDownloadInShell(download); 696 delegate_->ShowDownloadInShell(download);
690 } 697 }
691 698
692 } // namespace content 699 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698