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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 // Called when the page is first loaded. | 163 // Called when the page is first loaded. |
164 void OnPageLoaded(const base::ListValue* args); | 164 void OnPageLoaded(const base::ListValue* args); |
165 | 165 |
166 // Called when GetGCacheContents() is complete. | 166 // Called when GetGCacheContents() is complete. |
167 void OnGetGCacheContents(base::ListValue* gcache_contents, | 167 void OnGetGCacheContents(base::ListValue* gcache_contents, |
168 base::DictionaryValue* cache_summary); | 168 base::DictionaryValue* cache_summary); |
169 | 169 |
170 // Called when ReadDirectoryByPath() is complete. | 170 // Called when ReadDirectoryByPath() is complete. |
171 void OnReadDirectoryByPath(const FilePath& parent_path, | 171 void OnReadDirectoryByPath(const FilePath& parent_path, |
172 gdata::GDataFileError error, | 172 gdata::GDataFileError error, |
| 173 bool hide_hosted_documents, |
173 scoped_ptr<gdata::GDataEntryProtoVector> entries); | 174 scoped_ptr<gdata::GDataEntryProtoVector> entries); |
174 | 175 |
175 // Called when GetResourceIdsOfAllFilesOnUIThread() is complete. | 176 // Called when GetResourceIdsOfAllFilesOnUIThread() is complete. |
176 void OnGetResourceIdsOfAllFiles( | 177 void OnGetResourceIdsOfAllFiles( |
177 const std::vector<std::string>& resource_ids); | 178 const std::vector<std::string>& resource_ids); |
178 | 179 |
179 // Called when GetCacheEntryOnUIThread() is complete. | 180 // Called when GetCacheEntryOnUIThread() is complete. |
180 void OnGetCacheEntry(const std::string& resource_id, | 181 void OnGetCacheEntry(const std::string& resource_id, |
181 bool success, | 182 bool success, |
182 const gdata::GDataCacheEntry& cache_entry); | 183 const gdata::GDataCacheEntry& cache_entry); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 system_service->file_system()->ReadDirectoryByPath( | 256 system_service->file_system()->ReadDirectoryByPath( |
256 root_path, | 257 root_path, |
257 base::Bind(&DriveInternalsWebUIHandler::OnReadDirectoryByPath, | 258 base::Bind(&DriveInternalsWebUIHandler::OnReadDirectoryByPath, |
258 weak_ptr_factory_.GetWeakPtr(), | 259 weak_ptr_factory_.GetWeakPtr(), |
259 root_path)); | 260 root_path)); |
260 } | 261 } |
261 | 262 |
262 void DriveInternalsWebUIHandler::OnReadDirectoryByPath( | 263 void DriveInternalsWebUIHandler::OnReadDirectoryByPath( |
263 const FilePath& parent_path, | 264 const FilePath& parent_path, |
264 gdata::GDataFileError error, | 265 gdata::GDataFileError error, |
| 266 bool hide_hosted_documents, |
265 scoped_ptr<gdata::GDataEntryProtoVector> entries) { | 267 scoped_ptr<gdata::GDataEntryProtoVector> entries) { |
266 --num_pending_reads_; | 268 --num_pending_reads_; |
267 if (error == gdata::GDATA_FILE_OK) { | 269 if (error == gdata::GDATA_FILE_OK) { |
268 DCHECK(entries.get()); | 270 DCHECK(entries.get()); |
269 | 271 |
270 std::string file_system_as_text; | 272 std::string file_system_as_text; |
271 for (size_t i = 0; i < entries->size(); ++i) { | 273 for (size_t i = 0; i < entries->size(); ++i) { |
272 const gdata::GDataEntryProto& entry = (*entries)[i]; | 274 const gdata::GDataEntryProto& entry = (*entries)[i]; |
273 const FilePath current_path = parent_path.Append( | 275 const FilePath current_path = parent_path.Append( |
274 FilePath::FromUTF8Unsafe(entry.base_name())); | 276 FilePath::FromUTF8Unsafe(entry.base_name())); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 new ChromeWebUIDataSource(chrome::kChromeUIDriveInternalsHost); | 348 new ChromeWebUIDataSource(chrome::kChromeUIDriveInternalsHost); |
347 source->add_resource_path("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); | 349 source->add_resource_path("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); |
348 source->add_resource_path("drive_internals.js", IDR_DRIVE_INTERNALS_JS); | 350 source->add_resource_path("drive_internals.js", IDR_DRIVE_INTERNALS_JS); |
349 source->set_default_resource(IDR_DRIVE_INTERNALS_HTML); | 351 source->set_default_resource(IDR_DRIVE_INTERNALS_HTML); |
350 | 352 |
351 Profile* profile = Profile::FromWebUI(web_ui); | 353 Profile* profile = Profile::FromWebUI(web_ui); |
352 ChromeURLDataManager::AddDataSource(profile, source); | 354 ChromeURLDataManager::AddDataSource(profile, source); |
353 } | 355 } |
354 | 356 |
355 } // namespace chromeos | 357 } // namespace chromeos |
OLD | NEW |