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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // Utility class which can listen for directory lister events and relay | 54 // Utility class which can listen for directory lister events and relay |
55 // them to the main object with the correct tracking id. | 55 // them to the main object with the correct tracking id. |
56 class DirectoryListerDispatchDelegate | 56 class DirectoryListerDispatchDelegate |
57 : public net::DirectoryLister::DirectoryListerDelegate { | 57 : public net::DirectoryLister::DirectoryListerDelegate { |
58 public: | 58 public: |
59 DirectoryListerDispatchDelegate(FileSelectHelper* parent, int id) | 59 DirectoryListerDispatchDelegate(FileSelectHelper* parent, int id) |
60 : parent_(parent), | 60 : parent_(parent), |
61 id_(id) {} | 61 id_(id) {} |
62 virtual ~DirectoryListerDispatchDelegate() {} | 62 virtual ~DirectoryListerDispatchDelegate() {} |
63 virtual void OnListFile( | 63 virtual void OnListFile( |
64 const net::DirectoryLister::DirectoryListerData& data) OVERRIDE { | 64 const net::DirectoryLister::DirectoryListerData& data) OVERRIDE; |
65 parent_->OnListFile(id_, data); | 65 virtual void OnListDone(int error) OVERRIDE; |
66 } | |
67 virtual void OnListDone(int error) OVERRIDE { | |
68 parent_->OnListDone(id_, error); | |
69 } | |
70 private: | 66 private: |
71 // This FileSelectHelper owns this object. | 67 // This FileSelectHelper owns this object. |
72 FileSelectHelper* parent_; | 68 FileSelectHelper* parent_; |
73 int id_; | 69 int id_; |
74 | 70 |
75 DISALLOW_COPY_AND_ASSIGN(DirectoryListerDispatchDelegate); | 71 DISALLOW_COPY_AND_ASSIGN(DirectoryListerDispatchDelegate); |
76 }; | 72 }; |
77 | 73 |
78 void RunFileChooser(content::RenderViewHost* render_view_host, | 74 void RunFileChooser(content::RenderViewHost* render_view_host, |
79 content::WebContents* tab_contents, | 75 content::WebContents* tab_contents, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 struct ActiveDirectoryEnumeration; | 154 struct ActiveDirectoryEnumeration; |
159 std::map<int, ActiveDirectoryEnumeration*> directory_enumerations_; | 155 std::map<int, ActiveDirectoryEnumeration*> directory_enumerations_; |
160 | 156 |
161 // Registrar for notifications regarding our RenderViewHost. | 157 // Registrar for notifications regarding our RenderViewHost. |
162 content::NotificationRegistrar notification_registrar_; | 158 content::NotificationRegistrar notification_registrar_; |
163 | 159 |
164 DISALLOW_COPY_AND_ASSIGN(FileSelectHelper); | 160 DISALLOW_COPY_AND_ASSIGN(FileSelectHelper); |
165 }; | 161 }; |
166 | 162 |
167 #endif // CHROME_BROWSER_FILE_SELECT_HELPER_H_ | 163 #endif // CHROME_BROWSER_FILE_SELECT_HELPER_H_ |
OLD | NEW |