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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 const base::Time last_modified = | 64 const base::Time last_modified = |
65 FileEnumerator::GetLastModifiedTime(find_info); | 65 FileEnumerator::GetLastModifiedTime(find_info); |
66 | 66 |
67 base::DictionaryValue* entry = new base::DictionaryValue; | 67 base::DictionaryValue* entry = new base::DictionaryValue; |
68 entry->SetString("path", current.value()); | 68 entry->SetString("path", current.value()); |
69 // Use double instead of integer for large files. | 69 // Use double instead of integer for large files. |
70 entry->SetDouble("size", size); | 70 entry->SetDouble("size", size); |
71 entry->SetBoolean("is_directory", is_directory); | 71 entry->SetBoolean("is_directory", is_directory); |
72 entry->SetBoolean("is_symbolic_link", is_symbolic_link); | 72 entry->SetBoolean("is_symbolic_link", is_symbolic_link); |
73 entry->SetString("last_modified", | 73 entry->SetString("last_modified", |
74 gdata::util::FormatTimeAsString(last_modified)); | 74 gdata::util::FormatTimeAsStringLocaltime(last_modified)); |
75 files[current] = entry; | 75 files[current] = entry; |
76 | 76 |
77 total_size += size; | 77 total_size += size; |
78 } | 78 } |
79 | 79 |
80 // Convert |files| into |gcache_contents|. | 80 // Convert |files| into |gcache_contents|. |
81 for (std::map<FilePath, DictionaryValue*>::const_iterator | 81 for (std::map<FilePath, DictionaryValue*>::const_iterator |
82 iter = files.begin(); iter != files.end(); ++iter) { | 82 iter = files.begin(); iter != files.end(); ++iter) { |
83 gcache_contents->Append(iter->second); | 83 gcache_contents->Append(iter->second); |
84 } | 84 } |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 new ChromeWebUIDataSource(chrome::kChromeUIDriveInternalsHost); | 348 new ChromeWebUIDataSource(chrome::kChromeUIDriveInternalsHost); |
349 source->add_resource_path("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); | 349 source->add_resource_path("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); |
350 source->add_resource_path("drive_internals.js", IDR_DRIVE_INTERNALS_JS); | 350 source->add_resource_path("drive_internals.js", IDR_DRIVE_INTERNALS_JS); |
351 source->set_default_resource(IDR_DRIVE_INTERNALS_HTML); | 351 source->set_default_resource(IDR_DRIVE_INTERNALS_HTML); |
352 | 352 |
353 Profile* profile = Profile::FromWebUI(web_ui); | 353 Profile* profile = Profile::FromWebUI(web_ui); |
354 ChromeURLDataManager::AddDataSource(profile, source); | 354 ChromeURLDataManager::AddDataSource(profile, source); |
355 } | 355 } |
356 | 356 |
357 } // namespace chromeos | 357 } // namespace chromeos |
OLD | NEW |