electron/shell/browser/web_dialog_helper.h

52 lines
1.3 KiB
C
Raw Normal View History

2014-10-30 16:37:14 +00:00
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
2019-06-19 20:56:58 +00:00
#ifndef SHELL_BROWSER_WEB_DIALOG_HELPER_H_
#define SHELL_BROWSER_WEB_DIALOG_HELPER_H_
2014-10-30 16:37:14 +00:00
#include <memory>
#include <vector>
2014-10-30 16:37:14 +00:00
#include "base/memory/weak_ptr.h"
#include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h"
2014-10-30 16:37:14 +00:00
namespace base {
class FilePath;
}
namespace content {
class FileSelectListener;
2016-09-06 08:24:37 +00:00
class RenderFrameHost;
2014-10-30 16:37:14 +00:00
class WebContents;
2018-04-18 01:44:10 +00:00
} // namespace content
2014-10-30 16:37:14 +00:00
namespace electron {
2014-10-30 16:37:14 +00:00
class NativeWindow;
class WebDialogHelper {
public:
2017-11-13 07:13:54 +00:00
WebDialogHelper(NativeWindow* window, bool offscreen);
2014-10-30 16:37:14 +00:00
~WebDialogHelper();
2016-09-06 08:24:37 +00:00
void RunFileChooser(content::RenderFrameHost* render_frame_host,
std::unique_ptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params);
2014-10-31 09:37:32 +00:00
void EnumerateDirectory(content::WebContents* web_contents,
std::unique_ptr<content::FileSelectListener> listener,
2014-10-31 09:37:32 +00:00
const base::FilePath& path);
2014-10-30 16:37:14 +00:00
private:
NativeWindow* window_;
bool offscreen_;
2014-10-30 16:37:14 +00:00
base::WeakPtrFactory<WebDialogHelper> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(WebDialogHelper);
};
} // namespace electron
2014-10-30 16:37:14 +00:00
2019-06-19 20:56:58 +00:00
#endif // SHELL_BROWSER_WEB_DIALOG_HELPER_H_