web_dialog_helper.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright (c) 2014 GitHub, Inc. All rights reserved.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ATOM_BROWSER_WEB_DIALOG_HELPER_H_
  5. #define ATOM_BROWSER_WEB_DIALOG_HELPER_H_
  6. #include "base/memory/weak_ptr.h"
  7. namespace base {
  8. class FilePath;
  9. }
  10. namespace content {
  11. struct FileChooserParams;
  12. class RenderFrameHost;
  13. class WebContents;
  14. }
  15. namespace atom {
  16. class NativeWindow;
  17. class WebDialogHelper {
  18. public:
  19. WebDialogHelper(NativeWindow* window, bool offscreen);
  20. ~WebDialogHelper();
  21. void RunFileChooser(content::RenderFrameHost* render_frame_host,
  22. const content::FileChooserParams& params);
  23. void EnumerateDirectory(content::WebContents* web_contents,
  24. int request_id,
  25. const base::FilePath& path);
  26. private:
  27. NativeWindow* window_;
  28. bool offscreen_;
  29. base::WeakPtrFactory<WebDialogHelper> weak_factory_;
  30. DISALLOW_COPY_AND_ASSIGN(WebDialogHelper);
  31. };
  32. } // namespace atom
  33. #endif // ATOM_BROWSER_WEB_DIALOG_HELPER_H_