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

Side by Side Diff: chromecast/shell/browser/cast_download_manager_delegate.cc

Issue 602593004: Chromecast: disables downloads from the Chromecast shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: formatting Created 6 years, 2 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
« no previous file with comments | « chromecast/shell/browser/cast_download_manager_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "chromecast/shell/browser/cast_download_manager_delegate.h"
6
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"
11
12 namespace chromecast {
13 namespace shell {
14
15 CastDownloadManagerDelegate::CastDownloadManagerDelegate() {}
16
17 CastDownloadManagerDelegate::~CastDownloadManagerDelegate() {}
18
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++);
24 }
25
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;
38 }
39
40 bool CastDownloadManagerDelegate::ShouldOpenFileBasedOnExtension(
41 const base::FilePath& path) {
42 return false;
43 }
44
45 bool CastDownloadManagerDelegate::ShouldCompleteDownload(
46 content::DownloadItem* item,
47 const base::Closure& callback) {
48 return false;
49 }
50
51 bool CastDownloadManagerDelegate::ShouldOpenDownload(
52 content::DownloadItem* item,
53 const content::DownloadOpenDelayedCallback& callback) {
54 return false;
55 }
56
57 } // namespace shell
58 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/shell/browser/cast_download_manager_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698