| 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/ui/webui/chromeos/drive_internals_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/drive_internals_ui.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 void GetGCacheContents(const FilePath& root_path, | 41 void GetGCacheContents(const FilePath& root_path, |
| 42 base::ListValue* gcache_contents, | 42 base::ListValue* gcache_contents, |
| 43 base::DictionaryValue* gcache_summary) { | 43 base::DictionaryValue* gcache_summary) { |
| 44 using file_util::FileEnumerator; | 44 using file_util::FileEnumerator; |
| 45 // Use this map to sort the result list by the path. | 45 // Use this map to sort the result list by the path. |
| 46 std::map<FilePath, DictionaryValue*> files; | 46 std::map<FilePath, DictionaryValue*> files; |
| 47 | 47 |
| 48 const int options = (file_util::FileEnumerator::FILES | | 48 const int options = (file_util::FileEnumerator::FILES | |
| 49 file_util::FileEnumerator::DIRECTORIES | | 49 file_util::FileEnumerator::DIRECTORIES | |
| 50 file_util::FileEnumerator::SHOW_SYM_LINKS); | 50 file_util::FileEnumerator::SHOW_SYM_LINKS); |
| 51 FileEnumerator enumerator( | 51 FileEnumerator enumerator(root_path, true /* recursive */, options); |
| 52 root_path, | |
| 53 true, // recursive | |
| 54 static_cast<FileEnumerator::FileType>(options)); | |
| 55 | 52 |
| 56 int64 total_size = 0; | 53 int64 total_size = 0; |
| 57 for (FilePath current = enumerator.Next(); !current.empty(); | 54 for (FilePath current = enumerator.Next(); !current.empty(); |
| 58 current = enumerator.Next()) { | 55 current = enumerator.Next()) { |
| 59 FileEnumerator::FindInfo find_info; | 56 FileEnumerator::FindInfo find_info; |
| 60 enumerator.GetFindInfo(&find_info); | 57 enumerator.GetFindInfo(&find_info); |
| 61 int64 size = FileEnumerator::GetFilesize(find_info); | 58 int64 size = FileEnumerator::GetFilesize(find_info); |
| 62 const bool is_directory = FileEnumerator::IsDirectory(find_info); | 59 const bool is_directory = FileEnumerator::IsDirectory(find_info); |
| 63 const bool is_symbolic_link = FileEnumerator::IsLink(find_info); | 60 const bool is_symbolic_link = FileEnumerator::IsLink(find_info); |
| 64 const base::Time last_modified = | 61 const base::Time last_modified = |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 new ChromeWebUIDataSource(chrome::kChromeUIDriveInternalsHost); | 345 new ChromeWebUIDataSource(chrome::kChromeUIDriveInternalsHost); |
| 349 source->add_resource_path("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); | 346 source->add_resource_path("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); |
| 350 source->add_resource_path("drive_internals.js", IDR_DRIVE_INTERNALS_JS); | 347 source->add_resource_path("drive_internals.js", IDR_DRIVE_INTERNALS_JS); |
| 351 source->set_default_resource(IDR_DRIVE_INTERNALS_HTML); | 348 source->set_default_resource(IDR_DRIVE_INTERNALS_HTML); |
| 352 | 349 |
| 353 Profile* profile = Profile::FromWebUI(web_ui); | 350 Profile* profile = Profile::FromWebUI(web_ui); |
| 354 ChromeURLDataManager::AddDataSource(profile, source); | 351 ChromeURLDataManager::AddDataSource(profile, source); |
| 355 } | 352 } |
| 356 | 353 |
| 357 } // namespace chromeos | 354 } // namespace chromeos |
| OLD | NEW |