#ifndef CEF_LIBCEF_BROWSER_FILE_DIALOG_RUNNER_H_
#define CEF_LIBCEF_BROWSER_FILE_DIALOG_RUNNER_H_
#pragma once
#include <vector>
#include "base/callback.h"
#include "base/files/file_path.h"
#include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h"
class AlloyBrowserHostImpl;
class CefFileDialogRunner {
public:
CefFileDialogRunner(const CefFileDialogRunner&) = delete;
CefFileDialogRunner& operator=(const CefFileDialogRunner&) = delete;
struct FileChooserParams : public blink::mojom::FileChooserParams {
int selected_accept_filter = 0;
bool overwriteprompt = true;
bool hidereadonly = true;
};
using RunFileChooserCallback =
base::OnceCallback<void(int, const std::vector<base::FilePath>&)>;
virtual void Run(AlloyBrowserHostImpl* browser,
const FileChooserParams& params,
RunFileChooserCallback callback) = 0;
protected:
friend std::default_delete<CefFileDialogRunner>;
CefFileDialogRunner() = default;
virtual ~CefFileDialogRunner() = default;
};
#endif