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

Unified Diff: chrome/browser/download/download_commands.h

Issue 852043002: Initial Implementation of Download Notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 10 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
Index: chrome/browser/download/download_commands.h
diff --git a/chrome/browser/download/download_commands.h b/chrome/browser/download/download_commands.h
new file mode 100644
index 0000000000000000000000000000000000000000..573f221a3688ce29cfd2ff16e2dafcdd3136ebf8
--- /dev/null
+++ b/chrome/browser/download/download_commands.h
@@ -0,0 +1,56 @@
+// Copyright 2015 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.
+
+#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMMANDS_H_
+#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMMANDS_H_
+
+#include "base/strings/string16.h"
+
+#include "chrome/browser/profiles/profile.h"
+#include "content/public/browser/download_item.h"
+#include "content/public/browser/page_navigator.h"
+#include "ui/gfx/image/image.h"
+
+class DownloadCommands {
+ public:
+ enum Command {
+ SHOW_IN_FOLDER = 1, // Open a folder view window with the item selected.
+ OPEN_WHEN_COMPLETE, // Open the download when it's finished.
+ ALWAYS_OPEN_TYPE, // Default this file extension to always open.
+ PLATFORM_OPEN, // Open using platform handler.
+ CANCEL, // Cancel the download.
+ PAUSE, // Pause a download.
+ RESUME, // Resume a download.
+ DISCARD, // Discard the malicious download.
+ KEEP, // Keep the malicious download.
+ RETRY, // Retry the download.
+ LEARN_MORE_SCANNING, // Show information about download scanning.
+ LEARN_MORE_INTERRUPTED, // Show information about interrupted downloads.
+ };
+
+ explicit DownloadCommands(content::DownloadItem* download_item);
asanka 2015/02/27 01:26:49 Document that |download_item| must outlive Downloa
yoshiki 2015/02/28 10:50:53 Done.
+ virtual ~DownloadCommands() {}
+
+ gfx::Image GetCommandIcon(Command command);
+
+ bool IsCommandEnabled(Command command) const;
+ bool IsCommandChecked(Command command) const;
+ bool IsCommandVisible(Command command) const;
+ void ExecuteCommand(Command command, Profile* profile);
+
+#if defined(OS_WIN) || defined(OS_LINUX) || \
+ (defined(OS_MACOSX) && !defined(OS_IOS))
+ bool IsDownloadPdf() const;
+ bool CanOpenPdfInSystemViewer() const;
+#endif
+
+ private:
+ int GetCommandIconId(Command command);
+
+ int GetAlwaysOpenStringId() const;
+
+ content::DownloadItem* download_item_;
+};
+
+#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMMANDS_H_

Powered by Google App Engine
This is Rietveld 408576698