refactor: rename the atom directory to shell
This commit is contained in:
parent
4575a4aae3
commit
d7f07e8a80
631 changed files with 0 additions and 0 deletions
78
shell/browser/web_dialog_helper.h
Normal file
78
shell/browser/web_dialog_helper.h
Normal file
|
@ -0,0 +1,78 @@
|
|||
// 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.
|
||||
|
||||
#ifndef ATOM_BROWSER_WEB_DIALOG_HELPER_H_
|
||||
#define ATOM_BROWSER_WEB_DIALOG_HELPER_H_
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "net/base/directory_lister.h"
|
||||
#include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h"
|
||||
|
||||
namespace base {
|
||||
class FilePath;
|
||||
}
|
||||
|
||||
namespace content {
|
||||
class FileSelectListener;
|
||||
class RenderFrameHost;
|
||||
class WebContents;
|
||||
} // namespace content
|
||||
|
||||
namespace atom {
|
||||
|
||||
class DirectoryListerHelperDelegate {
|
||||
public:
|
||||
virtual void OnDirectoryListerDone(
|
||||
std::vector<blink::mojom::FileChooserFileInfoPtr> file_info,
|
||||
base::FilePath base_dir) = 0;
|
||||
};
|
||||
|
||||
class DirectoryListerHelper
|
||||
: public net::DirectoryLister::DirectoryListerDelegate {
|
||||
public:
|
||||
DirectoryListerHelper(base::FilePath base,
|
||||
DirectoryListerHelperDelegate* helper);
|
||||
~DirectoryListerHelper() override;
|
||||
|
||||
private:
|
||||
void OnListFile(
|
||||
const net::DirectoryLister::DirectoryListerData& data) override;
|
||||
void OnListDone(int error) override;
|
||||
|
||||
base::FilePath base_dir_;
|
||||
DirectoryListerHelperDelegate* delegate_;
|
||||
std::vector<base::FilePath> paths_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(DirectoryListerHelper);
|
||||
};
|
||||
|
||||
class NativeWindow;
|
||||
|
||||
class WebDialogHelper {
|
||||
public:
|
||||
WebDialogHelper(NativeWindow* window, bool offscreen);
|
||||
~WebDialogHelper();
|
||||
|
||||
void RunFileChooser(content::RenderFrameHost* render_frame_host,
|
||||
std::unique_ptr<content::FileSelectListener> listener,
|
||||
const blink::mojom::FileChooserParams& params);
|
||||
void EnumerateDirectory(content::WebContents* web_contents,
|
||||
std::unique_ptr<content::FileSelectListener> listener,
|
||||
const base::FilePath& path);
|
||||
|
||||
private:
|
||||
NativeWindow* window_;
|
||||
bool offscreen_;
|
||||
|
||||
base::WeakPtrFactory<WebDialogHelper> weak_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(WebDialogHelper);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_BROWSER_WEB_DIALOG_HELPER_H_
|
Loading…
Add table
Add a link
Reference in a new issue