OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "net/base/directory_lister.h" | 5 #include "net/base/directory_lister.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 origin_loop_->PostTask(FROM_HERE, e); | 189 origin_loop_->PostTask(FROM_HERE, e); |
190 return; | 190 return; |
191 } | 191 } |
192 | 192 |
193 int types = file_util::FileEnumerator::FILES | | 193 int types = file_util::FileEnumerator::FILES | |
194 file_util::FileEnumerator::DIRECTORIES; | 194 file_util::FileEnumerator::DIRECTORIES; |
195 if (!recursive_) | 195 if (!recursive_) |
196 types |= file_util::FileEnumerator::INCLUDE_DOT_DOT; | 196 types |= file_util::FileEnumerator::INCLUDE_DOT_DOT; |
197 | 197 |
198 file_util::FileEnumerator file_enum(dir_, recursive_, | 198 file_util::FileEnumerator file_enum(dir_, recursive_, |
199 static_cast<file_util::FileEnumerator::FILE_TYPE>(types)); | 199 static_cast<file_util::FileEnumerator::FileType>(types)); |
200 | 200 |
201 FilePath path; | 201 FilePath path; |
202 while (lister_ && !(path = file_enum.Next()).empty()) { | 202 while (lister_ && !(path = file_enum.Next()).empty()) { |
203 DirectoryListerData data; | 203 DirectoryListerData data; |
204 file_enum.GetFindInfo(&data.info); | 204 file_enum.GetFindInfo(&data.info); |
205 data.path = path; | 205 data.path = path; |
206 e->AddData(data); | 206 e->AddData(data); |
207 | 207 |
208 /* TODO(brettw) bug 24107: It would be nice to send incremental updates. | 208 /* TODO(brettw) bug 24107: It would be nice to send incremental updates. |
209 We gather them all so they can be sorted, but eventually the sorting | 209 We gather them all so they can be sorted, but eventually the sorting |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 241 |
242 void DirectoryLister::OnReceivedData(const DirectoryListerData& data) { | 242 void DirectoryLister::OnReceivedData(const DirectoryListerData& data) { |
243 delegate_->OnListFile(data); | 243 delegate_->OnListFile(data); |
244 } | 244 } |
245 | 245 |
246 void DirectoryLister::OnDone(int error) { | 246 void DirectoryLister::OnDone(int error) { |
247 delegate_->OnListDone(error); | 247 delegate_->OnListDone(error); |
248 } | 248 } |
249 | 249 |
250 } // namespace net | 250 } // namespace net |
OLD | NEW |