Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Side by Side Diff: chrome/browser/extensions/api/file_system/file_entry_picker.h

Issue 2967223002: Move fileSystem API FilePicker class to own file (Closed)
Patch Set: no comment Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_ENTRY_PICKER_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_ENTRY_PICKER_H_
7
8 #include <vector>
9
10 #include "base/callback.h"
11 #include "base/memory/ref_counted.h"
12 #include "ui/shell_dialogs/select_file_dialog.h"
13
14 namespace base {
15 class FilePath;
16 } // namespace base
17
18 namespace content {
19 class WebContents;
20 } // namespace content
21
22 namespace extensions {
23
24 // Shows a dialog to the user to ask for the filename for a file to save or
25 // open. Deletes itself once the dialog is closed.
26 class FileEntryPicker : public ui::SelectFileDialog::Listener {
27 public:
28 using FilesSelectedCallback =
29 base::OnceCallback<void(const std::vector<base::FilePath>& paths)>;
Devlin 2017/07/05 19:08:05 nit: \n
michaelpg 2017/07/05 19:52:53 Done.
30 FileEntryPicker(content::WebContents* web_contents,
Devlin 2017/07/05 19:08:05 Document, either here or above the member variable
michaelpg 2017/07/05 19:52:53 Done.
31 const base::FilePath& suggested_name,
32 const ui::SelectFileDialog::FileTypeInfo& file_type_info,
33 ui::SelectFileDialog::Type picker_type,
34 FilesSelectedCallback&& files_selected_callback,
Devlin 2017/07/05 19:08:05 nit: maybe just pass by value here, and std::move
michaelpg 2017/07/05 19:52:53 Thanks for catching this. Yeah, what I had goes ag
35 base::OnceClosure&& file_selection_canceled_callback);
36 ~FileEntryPicker() override;
Devlin 2017/07/05 19:08:05 Can we make this private?
michaelpg 2017/07/05 19:52:53 Done (was copied code).
37
38 private:
39 // ui::SelectFileDialog::Listener implementation.
40 void FileSelected(const base::FilePath& path,
41 int index,
42 void* params) override;
43
Devlin 2017/07/05 19:08:05 no \n between overridden methods from the same cla
michaelpg 2017/07/05 19:52:53 Done (was copied code)
44 void FileSelectedWithExtraInfo(const ui::SelectedFileInfo& file,
45 int index,
46 void* params) override;
47
48 void MultiFilesSelected(const std::vector<base::FilePath>& files,
49 void* params) override;
50
51 void MultiFilesSelectedWithExtraInfo(
52 const std::vector<ui::SelectedFileInfo>& files,
53 void* params) override;
54
55 void FileSelectionCanceled(void* params) override;
56
57 FilesSelectedCallback files_selected_callback_;
58 base::OnceClosure file_selection_canceled_callback_;
59 scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
60
61 DISALLOW_COPY_AND_ASSIGN(FileEntryPicker);
62 };
63
64 } // namespace extensions
65
66 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_ENTRY_PICKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698