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

Unified 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, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/shell/browser/cast_download_manager_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/shell/browser/cast_download_manager_delegate.cc
diff --git a/chromecast/shell/browser/cast_download_manager_delegate.cc b/chromecast/shell/browser/cast_download_manager_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..edc35f0da50f5f1b3099bf1cebd753249d7b8020
--- /dev/null
+++ b/chromecast/shell/browser/cast_download_manager_delegate.cc
@@ -0,0 +1,58 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromecast/shell/browser/cast_download_manager_delegate.h"
+
+#include "base/files/file_path.h"
+#include "base/logging.h"
+#include "content/public/browser/download_danger_type.h"
+#include "content/public/browser/download_item.h"
+
+namespace chromecast {
+namespace shell {
+
+CastDownloadManagerDelegate::CastDownloadManagerDelegate() {}
+
+CastDownloadManagerDelegate::~CastDownloadManagerDelegate() {}
+
+void CastDownloadManagerDelegate::GetNextId(
+ const content::DownloadIdCallback& callback) {
+ // See default behavior of DownloadManagerImpl::GetNextId()
+ static uint32 next_id = content::DownloadItem::kInvalidId + 1;
+ callback.Run(next_id++);
+}
+
+bool CastDownloadManagerDelegate::DetermineDownloadTarget(
+ content::DownloadItem* item,
+ const content::DownloadTargetCallback& callback) {
+ // Running the DownloadTargetCallback with an empty FilePath signals
+ // that the download should be cancelled.
+ base::FilePath empty;
+ callback.Run(
+ empty,
+ content::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
+ content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT,
+ empty);
+ return true;
+}
+
+bool CastDownloadManagerDelegate::ShouldOpenFileBasedOnExtension(
+ const base::FilePath& path) {
+ return false;
+}
+
+bool CastDownloadManagerDelegate::ShouldCompleteDownload(
+ content::DownloadItem* item,
+ const base::Closure& callback) {
+ return false;
+}
+
+bool CastDownloadManagerDelegate::ShouldOpenDownload(
+ content::DownloadItem* item,
+ const content::DownloadOpenDelayedCallback& callback) {
+ return false;
+}
+
+} // namespace shell
+} // namespace chromecast
« 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