]> khamidou — GitHub mirrors - electron.git/commitdiff
Add WebDialogHelper
authorCheng Zhao <zcbenz@gmail.com>
Thu, 30 Oct 2014 16:37:14 +0000 (00:37 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 30 Oct 2014 16:37:14 +0000 (00:37 +0800)
atom.gyp
atom/browser/web_dialog_helper.cc [new file with mode: 0644]
atom/browser/web_dialog_helper.h [new file with mode: 0644]

index 6a1ba0643937e509efe26eee05581cb4792fb0e2..6000194e0d2a582a69f5da100c8495eb46e45868 100644 (file)
--- a/atom.gyp
+++ b/atom.gyp
       'atom/browser/web_view/web_view_manager.h',
       'atom/browser/web_view/web_view_renderer_state.cc',
       'atom/browser/web_view/web_view_renderer_state.h',
+      'atom/browser/web_dialog_helper.cc',
+      'atom/browser/web_dialog_helper.h',
       'atom/browser/window_list.cc',
       'atom/browser/window_list.h',
       'atom/browser/window_list_observer.h',
diff --git a/atom/browser/web_dialog_helper.cc b/atom/browser/web_dialog_helper.cc
new file mode 100644 (file)
index 0000000..d0b53bc
--- /dev/null
@@ -0,0 +1,29 @@
+// 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.
+
+#include "atom/browser/web_dialog_helper.h"
+
+#include "atom/browser/ui/file_dialog.h"
+#include "base/bind.h"
+
+namespace atom {
+
+WebDialogHelper::WebDialogHelper(content::WebContents* web_contents,
+                                 NativeWindow* window)
+    : web_contents_(web_contents),
+      window_(window),
+      weak_factory_(this) {
+}
+
+WebDialogHelper::~WebDialogHelper() {
+}
+
+void WebDialogHelper::RunFileChooser(const content::FileChooserParams& params) {
+}
+
+void WebDialogHelper::EnumerateDirectory(int request_id,
+                                         const base::FilePath& path) {
+}
+
+}  // namespace atom
diff --git a/atom/browser/web_dialog_helper.h b/atom/browser/web_dialog_helper.h
new file mode 100644 (file)
index 0000000..27d32d6
--- /dev/null
@@ -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_