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 #include "chrome/browser/file_select_helper.h" | 5 #include "chrome/browser/file_select_helper.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 void FileSelectHelper::FileSelectionCanceled(void* params) { | 184 void FileSelectHelper::FileSelectionCanceled(void* params) { |
185 NotifyRenderViewHostAndEnd(std::vector<ui::SelectedFileInfo>()); | 185 NotifyRenderViewHostAndEnd(std::vector<ui::SelectedFileInfo>()); |
186 } | 186 } |
187 | 187 |
188 void FileSelectHelper::StartNewEnumeration(const base::FilePath& path, | 188 void FileSelectHelper::StartNewEnumeration(const base::FilePath& path, |
189 int request_id, | 189 int request_id, |
190 RenderViewHost* render_view_host) { | 190 RenderViewHost* render_view_host) { |
191 scoped_ptr<ActiveDirectoryEnumeration> entry(new ActiveDirectoryEnumeration); | 191 scoped_ptr<ActiveDirectoryEnumeration> entry(new ActiveDirectoryEnumeration); |
192 entry->rvh_ = render_view_host; | 192 entry->rvh_ = render_view_host; |
193 entry->delegate_.reset(new DirectoryListerDispatchDelegate(this, request_id)); | 193 entry->delegate_.reset(new DirectoryListerDispatchDelegate(this, request_id)); |
194 entry->lister_.reset(new net::DirectoryLister(path, | 194 entry->lister_.reset(new net::DirectoryLister( |
195 true, | 195 path, |
196 net::DirectoryLister::NO_SORT, | 196 net::DirectoryLister::NO_SORT_RECURSIVE, |
197 entry->delegate_.get())); | 197 entry->delegate_.get())); |
mmenke
2015/04/23 14:57:00
nit: Should now use 4-space indent here (4 spaces
sky
2015/04/23 16:40:39
Just run git cl format. It should do the right thi
| |
198 if (!entry->lister_->Start()) { | 198 if (!entry->lister_->Start()) { |
199 if (request_id == kFileSelectEnumerationId) | 199 if (request_id == kFileSelectEnumerationId) |
200 FileSelectionCanceled(NULL); | 200 FileSelectionCanceled(NULL); |
201 else | 201 else |
202 render_view_host->DirectoryEnumerationFinished(request_id, | 202 render_view_host->DirectoryEnumerationFinished(request_id, |
203 entry->results_); | 203 entry->results_); |
204 } else { | 204 } else { |
205 directory_enumerations_[request_id] = entry.release(); | 205 directory_enumerations_[request_id] = entry.release(); |
206 } | 206 } |
207 } | 207 } |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
566 // of an extension or a "/" in the case of a MIME type). | 566 // of an extension or a "/" in the case of a MIME type). |
567 std::string unused; | 567 std::string unused; |
568 if (accept_type.length() <= 1 || | 568 if (accept_type.length() <= 1 || |
569 base::StringToLowerASCII(accept_type) != accept_type || | 569 base::StringToLowerASCII(accept_type) != accept_type || |
570 base::TrimWhitespaceASCII(accept_type, base::TRIM_ALL, &unused) != | 570 base::TrimWhitespaceASCII(accept_type, base::TRIM_ALL, &unused) != |
571 base::TRIM_NONE) { | 571 base::TRIM_NONE) { |
572 return false; | 572 return false; |
573 } | 573 } |
574 return true; | 574 return true; |
575 } | 575 } |
OLD | NEW |