summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui/filebrowse_ui.cc
diff options
context:
space:
mode:
authorjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-21 23:25:22 +0000
committerjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-21 23:25:22 +0000
commit9ee2c8d83a4680bd6d78cbac7720170f602d42b1 (patch)
tree2cee50ea810d7e37431c99c0e3bdcb08f4ed3d12 /chrome/browser/dom_ui/filebrowse_ui.cc
parentab8b3728e44decabaf5484eb93e5d4f9cfcd1efb (diff)
downloadchromium_src-9ee2c8d83a4680bd6d78cbac7720170f602d42b1.zip
chromium_src-9ee2c8d83a4680bd6d78cbac7720170f602d42b1.tar.gz
chromium_src-9ee2c8d83a4680bd6d78cbac7720170f602d42b1.tar.bz2
Allow net::DirectoryLister to be used to recursively list the directory, and add a FULL_PATH sort option.
BUG=41762 TEST=unit test Review URL: http://codereview.chromium.org/3175023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57005 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/filebrowse_ui.cc')
-rw-r--r--chrome/browser/dom_ui/filebrowse_ui.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/chrome/browser/dom_ui/filebrowse_ui.cc b/chrome/browser/dom_ui/filebrowse_ui.cc
index 17d760f..6d78005 100644
--- a/chrome/browser/dom_ui/filebrowse_ui.cc
+++ b/chrome/browser/dom_ui/filebrowse_ui.cc
@@ -107,7 +107,8 @@ class FilebrowseHandler : public net::DirectoryLister::DirectoryListerDelegate,
void Init();
// DirectoryLister::DirectoryListerDelegate methods:
- virtual void OnListFile(const file_util::FileEnumerator::FindInfo& data);
+ virtual void OnListFile(
+ const net::DirectoryLister::DirectoryListerData& data);
virtual void OnListDone(int error);
// DOMMessageHandler implementation.
@@ -766,6 +767,7 @@ void FilebrowseHandler::GetChildrenForPath(FilePath& path, bool is_refresh) {
}
if (currentpath_ == default_download_path) {
lister_ = new net::DirectoryLister(currentpath_,
+ false,
net::DirectoryLister::DATE,
this);
} else {
@@ -785,13 +787,13 @@ void FilebrowseHandler::HandleGetChildren(const ListValue* args) {
}
void FilebrowseHandler::OnListFile(
- const file_util::FileEnumerator::FindInfo& data) {
+ const net::DirectoryLister::DirectoryListerData& data) {
#if defined(OS_WIN)
- if (data.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) {
+ if (data.info.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) {
return;
}
#elif defined(OS_POSIX)
- if (data.filename[0] == '.') {
+ if (data.info.filename[0] == '.') {
return;
}
#endif
@@ -799,18 +801,18 @@ void FilebrowseHandler::OnListFile(
DictionaryValue* file_value = new DictionaryValue();
#if defined(OS_WIN)
- int64 size = (static_cast<int64>(data.nFileSizeHigh) << 32) |
- data.nFileSizeLow;
- file_value->SetString(kPropertyTitle, data.cFileName);
+ int64 size = (static_cast<int64>(data.info.nFileSizeHigh) << 32) |
+ data.info.nFileSizeLow;
+ file_value->SetString(kPropertyTitle, data.info.cFileName);
file_value->SetString(kPropertyPath,
- currentpath_.Append(data.cFileName).value());
+ currentpath_.Append(data.info.cFileName).value());
file_value->SetBoolean(kPropertyDirectory,
- (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? true : false);
+ (data.info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? true : false);
#elif defined(OS_POSIX)
- file_value->SetString(kPropertyTitle, data.filename);
+ file_value->SetString(kPropertyTitle, data.info.filename);
file_value->SetString(kPropertyPath,
- currentpath_.Append(data.filename).value());
- file_value->SetBoolean(kPropertyDirectory, S_ISDIR(data.stat.st_mode));
+ currentpath_.Append(data.info.filename).value());
+ file_value->SetBoolean(kPropertyDirectory, S_ISDIR(data.info.stat.st_mode));
#endif
filelist_value_->Append(file_value);
}