web_dialog_helper.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. explicit WebDialogHelper(NativeWindow* window);
  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. base::WeakPtrFactory<WebDialogHelper> weak_factory_;
  29. DISALLOW_COPY_AND_ASSIGN(WebDialogHelper);
  30. };
  31. } // namespace atom
  32. #endif // ATOM_BROWSER_WEB_DIALOG_HELPER_H_