Add WebDialogHelper

This commit is contained in:
Cheng Zhao 2014-10-31 00:37:14 +08:00
parent 9ed6ad8165
commit b710cc3063
3 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1,44 @@
// 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 <vector>
#include "base/memory/weak_ptr.h"
namespace base {
class FilePath;
}
namespace content {
class WebContents;
class FileChooserParams;
}
namespace atom {
class NativeWindow;
class WebDialogHelper {
public:
WebDialogHelper(content::WebContents* web_contents, NativeWindow* window);
~WebDialogHelper();
void RunFileChooser(const content::FileChooserParams& params);
void EnumerateDirectory(int request_id, const base::FilePath& path);
private:
content::WebContents* web_contents_;
NativeWindow* window_;
base::WeakPtrFactory<WebDialogHelper> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(WebDialogHelper);
};
} // namespace atom
#endif // ATOM_BROWSER_WEB_DIALOG_HELPER_H_