| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 web_ui()->CallJavascriptFunction("updateGCacheContents", | 273 web_ui()->CallJavascriptFunction("updateGCacheContents", |
| 274 *gcache_contents, | 274 *gcache_contents, |
| 275 *gcache_summary); | 275 *gcache_summary); |
| 276 | 276 |
| 277 // Start updating the file system tree section, if we have access token. | 277 // Start updating the file system tree section, if we have access token. |
| 278 gdata::GDataSystemService* system_service = GetSystemService(); | 278 gdata::GDataSystemService* system_service = GetSystemService(); |
| 279 if (!system_service->drive_service()->HasAccessToken()) | 279 if (!system_service->drive_service()->HasAccessToken()) |
| 280 return; | 280 return; |
| 281 | 281 |
| 282 // Start rendering the file system tree as text. | 282 // Start rendering the file system tree as text. |
| 283 const FilePath root_path = FilePath(gdata::kGDataRootDirectory); | 283 const FilePath root_path = FilePath(gdata::kDriveRootDirectory); |
| 284 ++num_pending_reads_; | 284 ++num_pending_reads_; |
| 285 system_service->file_system()->ReadDirectoryByPath( | 285 system_service->file_system()->ReadDirectoryByPath( |
| 286 root_path, | 286 root_path, |
| 287 base::Bind(&DriveInternalsWebUIHandler::OnReadDirectoryByPath, | 287 base::Bind(&DriveInternalsWebUIHandler::OnReadDirectoryByPath, |
| 288 weak_ptr_factory_.GetWeakPtr(), | 288 weak_ptr_factory_.GetWeakPtr(), |
| 289 root_path)); | 289 root_path)); |
| 290 } | 290 } |
| 291 | 291 |
| 292 void DriveInternalsWebUIHandler::OnReadDirectoryByPath( | 292 void DriveInternalsWebUIHandler::OnReadDirectoryByPath( |
| 293 const FilePath& parent_path, | 293 const FilePath& parent_path, |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 new ChromeWebUIDataSource(chrome::kChromeUIDriveInternalsHost); | 386 new ChromeWebUIDataSource(chrome::kChromeUIDriveInternalsHost); |
| 387 source->add_resource_path("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); | 387 source->add_resource_path("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); |
| 388 source->add_resource_path("drive_internals.js", IDR_DRIVE_INTERNALS_JS); | 388 source->add_resource_path("drive_internals.js", IDR_DRIVE_INTERNALS_JS); |
| 389 source->set_default_resource(IDR_DRIVE_INTERNALS_HTML); | 389 source->set_default_resource(IDR_DRIVE_INTERNALS_HTML); |
| 390 | 390 |
| 391 Profile* profile = Profile::FromWebUI(web_ui); | 391 Profile* profile = Profile::FromWebUI(web_ui); |
| 392 ChromeURLDataManager::AddDataSource(profile, source); | 392 ChromeURLDataManager::AddDataSource(profile, source); |
| 393 } | 393 } |
| 394 | 394 |
| 395 } // namespace chromeos | 395 } // namespace chromeos |
| OLD | NEW |