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 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // allocated memory. | 108 // allocated memory. |
109 std::map<int, ActiveDirectoryEnumeration*>::iterator iter; | 109 std::map<int, ActiveDirectoryEnumeration*>::iterator iter; |
110 for (iter = directory_enumerations_.begin(); | 110 for (iter = directory_enumerations_.begin(); |
111 iter != directory_enumerations_.end(); | 111 iter != directory_enumerations_.end(); |
112 ++iter) { | 112 ++iter) { |
113 iter->second->lister_.reset(); | 113 iter->second->lister_.reset(); |
114 delete iter->second; | 114 delete iter->second; |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
| 118 void FileSelectHelper::DirectoryListerDispatchDelegate::OnListFile( |
| 119 const net::DirectoryLister::DirectoryListerData& data) { |
| 120 parent_->OnListFile(id_, data); |
| 121 } |
| 122 |
| 123 void FileSelectHelper::DirectoryListerDispatchDelegate::OnListDone(int error) { |
| 124 parent_->OnListDone(id_, error); |
| 125 } |
| 126 |
118 void FileSelectHelper::FileSelected(const FilePath& path, | 127 void FileSelectHelper::FileSelected(const FilePath& path, |
119 int index, void* params) { | 128 int index, void* params) { |
120 FileSelectedWithExtraInfo(ui::SelectedFileInfo(path, path), index, params); | 129 FileSelectedWithExtraInfo(ui::SelectedFileInfo(path, path), index, params); |
121 } | 130 } |
122 | 131 |
123 void FileSelectHelper::FileSelectedWithExtraInfo( | 132 void FileSelectHelper::FileSelectedWithExtraInfo( |
124 const ui::SelectedFileInfo& file, | 133 const ui::SelectedFileInfo& file, |
125 int index, | 134 int index, |
126 void* params) { | 135 void* params) { |
127 if (!render_view_host_) | 136 if (!render_view_host_) |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 // A 1 character accept type will always be invalid (either a "." in the case | 482 // A 1 character accept type will always be invalid (either a "." in the case |
474 // of an extension or a "/" in the case of a MIME type). | 483 // of an extension or a "/" in the case of a MIME type). |
475 std::string unused; | 484 std::string unused; |
476 if (accept_type.length() <= 1 || | 485 if (accept_type.length() <= 1 || |
477 StringToLowerASCII(accept_type) != accept_type || | 486 StringToLowerASCII(accept_type) != accept_type || |
478 TrimWhitespaceASCII(accept_type, TRIM_ALL, &unused) != TRIM_NONE) { | 487 TrimWhitespaceASCII(accept_type, TRIM_ALL, &unused) != TRIM_NONE) { |
479 return false; | 488 return false; |
480 } | 489 } |
481 return true; | 490 return true; |
482 } | 491 } |
OLD | NEW |