#include "chrome/browser/download/download_open_prompt.h"
#include <memory>
#include <utility>
#include "base/functional/callback.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/tab_modal_confirm_dialog.h"
#include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h"
#include "chrome/grit/generated_resources.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
namespace {
class DownloadOpenConfirmationDialog : public DownloadOpenPrompt,
public TabModalConfirmDialogDelegate { … };
DownloadOpenConfirmationDialog::DownloadOpenConfirmationDialog(
content::WebContents* web_contents,
const std::string& extension_name,
const base::FilePath& file_path,
DownloadOpenPrompt::OpenCallback open_callback)
: … { … }
DownloadOpenConfirmationDialog::~DownloadOpenConfirmationDialog() = default;
std::u16string DownloadOpenConfirmationDialog::GetTitle() { … }
std::u16string DownloadOpenConfirmationDialog::GetDialogMessage() { … }
std::u16string DownloadOpenConfirmationDialog::GetAcceptButtonTitle() { … }
std::u16string DownloadOpenConfirmationDialog::GetCancelButtonTitle() { … }
void DownloadOpenConfirmationDialog::OnAccepted() { … }
void DownloadOpenConfirmationDialog::OnCanceled() { … }
void DownloadOpenConfirmationDialog::OnClosed() { … }
}
DownloadOpenPrompt::DownloadOpenPrompt() = default;
DownloadOpenPrompt::~DownloadOpenPrompt() = default;
DownloadOpenPrompt* DownloadOpenPrompt::CreateDownloadOpenConfirmationDialog(
content::WebContents* web_contents,
const std::string& extension_name,
const base::FilePath& file_path,
DownloadOpenPrompt::OpenCallback open_callback) { … }
void DownloadOpenPrompt::AcceptConfirmationDialogForTesting(
DownloadOpenPrompt* download_open_prompt) { … }