| 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 StringAppendF(&out, "%s\n", path.AsUTF8Unsafe().c_str()); | 131 StringAppendF(&out, "%s\n", path.AsUTF8Unsafe().c_str()); |
| 132 StringAppendF(&out, " title: %s\n", entry.title().c_str()); | 132 StringAppendF(&out, " title: %s\n", entry.title().c_str()); |
| 133 StringAppendF(&out, " resource_id: %s\n", entry.resource_id().c_str()); | 133 StringAppendF(&out, " resource_id: %s\n", entry.resource_id().c_str()); |
| 134 StringAppendF(&out, " parent_resource_id: %s\n", | 134 StringAppendF(&out, " parent_resource_id: %s\n", |
| 135 entry.parent_resource_id().c_str()); | 135 entry.parent_resource_id().c_str()); |
| 136 StringAppendF(&out, " shared_with_me: %s\n", | 136 StringAppendF(&out, " shared_with_me: %s\n", |
| 137 entry.shared_with_me() ? "true" : "false"); | 137 entry.shared_with_me() ? "true" : "false"); |
| 138 | 138 |
| 139 const drive::PlatformFileInfoProto& file_info = entry.file_info(); | 139 const drive::PlatformFileInfoProto& file_info = entry.file_info(); |
| 140 StringAppendF(&out, " file_info\n"); | 140 StringAppendF(&out, " file_info\n"); |
| 141 StringAppendF(&out, " size: %"PRId64"\n", file_info.size()); | 141 StringAppendF(&out, " size: %" PRId64 "\n", file_info.size()); |
| 142 StringAppendF(&out, " is_directory: %d\n", file_info.is_directory()); | 142 StringAppendF(&out, " is_directory: %d\n", file_info.is_directory()); |
| 143 StringAppendF(&out, " is_symbolic_link: %d\n", | 143 StringAppendF(&out, " is_symbolic_link: %d\n", |
| 144 file_info.is_symbolic_link()); | 144 file_info.is_symbolic_link()); |
| 145 | 145 |
| 146 const base::Time last_modified = base::Time::FromInternalValue( | 146 const base::Time last_modified = base::Time::FromInternalValue( |
| 147 file_info.last_modified()); | 147 file_info.last_modified()); |
| 148 const base::Time last_accessed = base::Time::FromInternalValue( | 148 const base::Time last_accessed = base::Time::FromInternalValue( |
| 149 file_info.last_accessed()); | 149 file_info.last_accessed()); |
| 150 const base::Time creation_time = base::Time::FromInternalValue( | 150 const base::Time creation_time = base::Time::FromInternalValue( |
| 151 file_info.creation_time()); | 151 file_info.creation_time()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 170 StringAppendF(&out, " document_extension: %s\n", | 170 StringAppendF(&out, " document_extension: %s\n", |
| 171 file_specific_info.document_extension().c_str()); | 171 file_specific_info.document_extension().c_str()); |
| 172 StringAppendF(&out, " is_hosted_document: %d\n", | 172 StringAppendF(&out, " is_hosted_document: %d\n", |
| 173 file_specific_info.is_hosted_document()); | 173 file_specific_info.is_hosted_document()); |
| 174 } | 174 } |
| 175 | 175 |
| 176 if (entry.has_directory_specific_info()) { | 176 if (entry.has_directory_specific_info()) { |
| 177 StringAppendF(&out, " directory_info\n"); | 177 StringAppendF(&out, " directory_info\n"); |
| 178 const drive::DirectorySpecificInfo& directory_specific_info = | 178 const drive::DirectorySpecificInfo& directory_specific_info = |
| 179 entry.directory_specific_info(); | 179 entry.directory_specific_info(); |
| 180 StringAppendF(&out, " changestamp: %"PRId64"\n", | 180 StringAppendF(&out, " changestamp: %" PRId64 "\n", |
| 181 directory_specific_info.changestamp()); | 181 directory_specific_info.changestamp()); |
| 182 } | 182 } |
| 183 | 183 |
| 184 return out; | 184 return out; |
| 185 } | 185 } |
| 186 | 186 |
| 187 // Class to handle messages from chrome://drive-internals. | 187 // Class to handle messages from chrome://drive-internals. |
| 188 class DriveInternalsWebUIHandler : public content::WebUIMessageHandler { | 188 class DriveInternalsWebUIHandler : public content::WebUIMessageHandler { |
| 189 public: | 189 public: |
| 190 DriveInternalsWebUIHandler() | 190 DriveInternalsWebUIHandler() |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); | 800 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); |
| 801 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); | 801 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); |
| 802 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); | 802 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); |
| 803 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); | 803 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); |
| 804 | 804 |
| 805 Profile* profile = Profile::FromWebUI(web_ui); | 805 Profile* profile = Profile::FromWebUI(web_ui); |
| 806 content::WebUIDataSource::Add(profile, source); | 806 content::WebUIDataSource::Add(profile, source); |
| 807 } | 807 } |
| 808 | 808 |
| 809 } // namespace chromeos | 809 } // namespace chromeos |
| OLD | NEW |