#include "chrome/browser/download/download_commands.h"
#include <stdint.h>
#include "base/base64.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/threading/scoped_blocking_call.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_crx_util.h"
#include "chrome/browser/download/download_ui_model.h"
#include "chrome/browser/image_decoder/image_decoder.h"
#include "chrome/common/url_constants.h"
#include "components/google/core/common/google_util.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/url_util.h"
#include "ui/base/clipboard/scoped_clipboard_writer.h"
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
BUILDFLAG(IS_MAC)
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
#endif
#if BUILDFLAG(IS_WIN)
#include "chrome/browser/download/download_target_determiner.h"
#endif
namespace {
const int64_t kMaxImageClipboardSize = …;
class ImageClipboardCopyManager : public ImageDecoder::ImageRequest { … };
}
DownloadCommands::DownloadCommands(base::WeakPtr<DownloadUIModel> model)
: … { … }
DownloadCommands::~DownloadCommands() = default;
GURL DownloadCommands::GetLearnMoreURLForInterruptedDownload() const { … }
bool DownloadCommands::IsCommandEnabled(Command command) const { … }
bool DownloadCommands::IsCommandChecked(Command command) const { … }
bool DownloadCommands::IsCommandVisible(Command command) const { … }
void DownloadCommands::ExecuteCommand(Command command) { … }
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS)
Browser* DownloadCommands::GetBrowser() const { … }
bool DownloadCommands::IsDownloadPdf() const { … }
bool DownloadCommands::CanOpenPdfInSystemViewer() const { … }
#endif
void DownloadCommands::CopyFileAsImageToClipboard() { … }
bool DownloadCommands::CanBeCopiedToClipboard() const { … }