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/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 void DriveInternalsWebUIHandler::UpdateFileSystemContentsSection( | 575 void DriveInternalsWebUIHandler::UpdateFileSystemContentsSection( |
576 google_apis::DriveServiceInterface* drive_service) { | 576 google_apis::DriveServiceInterface* drive_service) { |
577 DCHECK(drive_service); | 577 DCHECK(drive_service); |
578 | 578 |
579 // Start updating the file system tree section, if we have access token. | 579 // Start updating the file system tree section, if we have access token. |
580 drive::DriveSystemService* system_service = GetSystemService(); | 580 drive::DriveSystemService* system_service = GetSystemService(); |
581 if (!system_service->drive_service()->HasAccessToken()) | 581 if (!system_service->drive_service()->HasAccessToken()) |
582 return; | 582 return; |
583 | 583 |
584 // Start rendering the file system tree as text. | 584 // Start rendering the file system tree as text. |
585 const base::FilePath root_path = drive::util::GetDriveMyDriveRootPath(); | 585 const base::FilePath root_path = drive::util::GetDriveGrandRootPath(); |
586 | 586 |
587 system_service->file_system()->GetEntryInfoByPath( | 587 system_service->file_system()->GetEntryInfoByPath( |
588 root_path, | 588 root_path, |
589 base::Bind(&DriveInternalsWebUIHandler::OnGetEntryInfoByPath, | 589 base::Bind(&DriveInternalsWebUIHandler::OnGetEntryInfoByPath, |
590 weak_ptr_factory_.GetWeakPtr(), | 590 weak_ptr_factory_.GetWeakPtr(), |
591 root_path)); | 591 root_path)); |
592 | 592 |
593 system_service->file_system()->ReadDirectoryByPath( | 593 system_service->file_system()->ReadDirectoryByPath( |
594 root_path, | 594 root_path, |
595 base::Bind(&DriveInternalsWebUIHandler::OnReadDirectoryByPath, | 595 base::Bind(&DriveInternalsWebUIHandler::OnReadDirectoryByPath, |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); | 747 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); |
748 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); | 748 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); |
749 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); | 749 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); |
750 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); | 750 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); |
751 | 751 |
752 Profile* profile = Profile::FromWebUI(web_ui); | 752 Profile* profile = Profile::FromWebUI(web_ui); |
753 content::WebUIDataSource::Add(profile, source); | 753 content::WebUIDataSource::Add(profile, source); |
754 } | 754 } |
755 | 755 |
756 } // namespace chromeos | 756 } // namespace chromeos |
OLD | NEW |