Drive: Add BatchableRequest subclass.
[chromium-blink-merge.git] / chromecast / browser / cast_download_manager_delegate.cc
blob9817fcb38d7220eee2b050467fd7a041e636714a
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chromecast/browser/cast_download_manager_delegate.h"
7 #include "base/files/file_path.h"
8 #include "base/logging.h"
9 #include "content/public/browser/download_danger_type.h"
10 #include "content/public/browser/download_item.h"
12 namespace chromecast {
13 namespace shell {
15 CastDownloadManagerDelegate::CastDownloadManagerDelegate() {}
17 CastDownloadManagerDelegate::~CastDownloadManagerDelegate() {}
19 void CastDownloadManagerDelegate::GetNextId(
20 const content::DownloadIdCallback& callback) {
21 // See default behavior of DownloadManagerImpl::GetNextId()
22 static uint32 next_id = content::DownloadItem::kInvalidId + 1;
23 callback.Run(next_id++);
26 bool CastDownloadManagerDelegate::DetermineDownloadTarget(
27 content::DownloadItem* item,
28 const content::DownloadTargetCallback& callback) {
29 // Running the DownloadTargetCallback with an empty FilePath signals
30 // that the download should be cancelled.
31 base::FilePath empty;
32 callback.Run(
33 empty,
34 content::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
35 content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT,
36 empty);
37 return true;
40 bool CastDownloadManagerDelegate::ShouldOpenFileBasedOnExtension(
41 const base::FilePath& path) {
42 return false;
45 bool CastDownloadManagerDelegate::ShouldCompleteDownload(
46 content::DownloadItem* item,
47 const base::Closure& callback) {
48 return false;
51 bool CastDownloadManagerDelegate::ShouldOpenDownload(
52 content::DownloadItem* item,
53 const content::DownloadOpenDelayedCallback& callback) {
54 return false;
57 } // namespace shell
58 } // namespace chromecast