OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_FILE_SELECT_HELPER_H_ | 5 #ifndef CHROME_BROWSER_FILE_SELECT_HELPER_H_ |
6 #define CHROME_BROWSER_FILE_SELECT_HELPER_H_ | 6 #define CHROME_BROWSER_FILE_SELECT_HELPER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // Utility class which can listen for directory lister events and relay | 55 // Utility class which can listen for directory lister events and relay |
56 // them to the main object with the correct tracking id. | 56 // them to the main object with the correct tracking id. |
57 class DirectoryListerDispatchDelegate | 57 class DirectoryListerDispatchDelegate |
58 : public net::DirectoryLister::DirectoryListerDelegate { | 58 : public net::DirectoryLister::DirectoryListerDelegate { |
59 public: | 59 public: |
60 DirectoryListerDispatchDelegate(FileSelectHelper* parent, int id) | 60 DirectoryListerDispatchDelegate(FileSelectHelper* parent, int id) |
61 : parent_(parent), | 61 : parent_(parent), |
62 id_(id) {} | 62 id_(id) {} |
63 virtual ~DirectoryListerDispatchDelegate() {} | 63 virtual ~DirectoryListerDispatchDelegate() {} |
64 virtual void OnListFile( | 64 virtual void OnListFile( |
65 const net::DirectoryLister::DirectoryListerData& data) OVERRIDE; | 65 const net::DirectoryLister::DirectoryListerData& data) override; |
66 virtual void OnListDone(int error) OVERRIDE; | 66 virtual void OnListDone(int error) override; |
67 private: | 67 private: |
68 // This FileSelectHelper owns this object. | 68 // This FileSelectHelper owns this object. |
69 FileSelectHelper* parent_; | 69 FileSelectHelper* parent_; |
70 int id_; | 70 int id_; |
71 | 71 |
72 DISALLOW_COPY_AND_ASSIGN(DirectoryListerDispatchDelegate); | 72 DISALLOW_COPY_AND_ASSIGN(DirectoryListerDispatchDelegate); |
73 }; | 73 }; |
74 | 74 |
75 void RunFileChooser(content::RenderViewHost* render_view_host, | 75 void RunFileChooser(content::RenderViewHost* render_view_host, |
76 content::WebContents* web_contents, | 76 content::WebContents* web_contents, |
77 const content::FileChooserParams& params); | 77 const content::FileChooserParams& params); |
78 void RunFileChooserOnFileThread( | 78 void RunFileChooserOnFileThread( |
79 const content::FileChooserParams& params); | 79 const content::FileChooserParams& params); |
80 void RunFileChooserOnUIThread( | 80 void RunFileChooserOnUIThread( |
81 const content::FileChooserParams& params); | 81 const content::FileChooserParams& params); |
82 | 82 |
83 // Cleans up and releases this instance. This must be called after the last | 83 // Cleans up and releases this instance. This must be called after the last |
84 // callback is received from the file chooser dialog. | 84 // callback is received from the file chooser dialog. |
85 void RunFileChooserEnd(); | 85 void RunFileChooserEnd(); |
86 | 86 |
87 // SelectFileDialog::Listener overrides. | 87 // SelectFileDialog::Listener overrides. |
88 virtual void FileSelected( | 88 virtual void FileSelected( |
89 const base::FilePath& path, int index, void* params) OVERRIDE; | 89 const base::FilePath& path, int index, void* params) override; |
90 virtual void FileSelectedWithExtraInfo( | 90 virtual void FileSelectedWithExtraInfo( |
91 const ui::SelectedFileInfo& file, | 91 const ui::SelectedFileInfo& file, |
92 int index, | 92 int index, |
93 void* params) OVERRIDE; | 93 void* params) override; |
94 virtual void MultiFilesSelected(const std::vector<base::FilePath>& files, | 94 virtual void MultiFilesSelected(const std::vector<base::FilePath>& files, |
95 void* params) OVERRIDE; | 95 void* params) override; |
96 virtual void MultiFilesSelectedWithExtraInfo( | 96 virtual void MultiFilesSelectedWithExtraInfo( |
97 const std::vector<ui::SelectedFileInfo>& files, | 97 const std::vector<ui::SelectedFileInfo>& files, |
98 void* params) OVERRIDE; | 98 void* params) override; |
99 virtual void FileSelectionCanceled(void* params) OVERRIDE; | 99 virtual void FileSelectionCanceled(void* params) override; |
100 | 100 |
101 // content::NotificationObserver overrides. | 101 // content::NotificationObserver overrides. |
102 virtual void Observe(int type, | 102 virtual void Observe(int type, |
103 const content::NotificationSource& source, | 103 const content::NotificationSource& source, |
104 const content::NotificationDetails& details) OVERRIDE; | 104 const content::NotificationDetails& details) override; |
105 | 105 |
106 void EnumerateDirectory(int request_id, | 106 void EnumerateDirectory(int request_id, |
107 content::RenderViewHost* render_view_host, | 107 content::RenderViewHost* render_view_host, |
108 const base::FilePath& path); | 108 const base::FilePath& path); |
109 | 109 |
110 // Kicks off a new directory enumeration. | 110 // Kicks off a new directory enumeration. |
111 void StartNewEnumeration(const base::FilePath& path, | 111 void StartNewEnumeration(const base::FilePath& path, |
112 int request_id, | 112 int request_id, |
113 content::RenderViewHost* render_view_host); | 113 content::RenderViewHost* render_view_host); |
114 | 114 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 content::NotificationRegistrar notification_registrar_; | 190 content::NotificationRegistrar notification_registrar_; |
191 | 191 |
192 // Temporary files only used on OSX. This class is responsible for deleting | 192 // Temporary files only used on OSX. This class is responsible for deleting |
193 // these files when they are no longer needed. | 193 // these files when they are no longer needed. |
194 std::vector<base::FilePath> temporary_files_; | 194 std::vector<base::FilePath> temporary_files_; |
195 | 195 |
196 DISALLOW_COPY_AND_ASSIGN(FileSelectHelper); | 196 DISALLOW_COPY_AND_ASSIGN(FileSelectHelper); |
197 }; | 197 }; |
198 | 198 |
199 #endif // CHROME_BROWSER_FILE_SELECT_HELPER_H_ | 199 #endif // CHROME_BROWSER_FILE_SELECT_HELPER_H_ |
OLD | NEW |