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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 void DriveInternalsWebUIHandler::UpdateFileSystemContentsSection( | 568 void DriveInternalsWebUIHandler::UpdateFileSystemContentsSection( |
569 google_apis::DriveServiceInterface* drive_service) { | 569 google_apis::DriveServiceInterface* drive_service) { |
570 DCHECK(drive_service); | 570 DCHECK(drive_service); |
571 | 571 |
572 // Start updating the file system tree section, if we have access token. | 572 // Start updating the file system tree section, if we have access token. |
573 drive::DriveSystemService* system_service = GetSystemService(); | 573 drive::DriveSystemService* system_service = GetSystemService(); |
574 if (!system_service->drive_service()->HasAccessToken()) | 574 if (!system_service->drive_service()->HasAccessToken()) |
575 return; | 575 return; |
576 | 576 |
577 // Start rendering the file system tree as text. | 577 // Start rendering the file system tree as text. |
578 const base::FilePath root_path = drive::util::GetDriveMyDriveRootPath(); | 578 const base::FilePath root_path = drive::util::GetDriveGrandRootPath(); |
579 | 579 |
580 system_service->file_system()->GetEntryInfoByPath( | 580 system_service->file_system()->GetEntryInfoByPath( |
581 root_path, | 581 root_path, |
582 base::Bind(&DriveInternalsWebUIHandler::OnGetEntryInfoByPath, | 582 base::Bind(&DriveInternalsWebUIHandler::OnGetEntryInfoByPath, |
583 weak_ptr_factory_.GetWeakPtr(), | 583 weak_ptr_factory_.GetWeakPtr(), |
584 root_path)); | 584 root_path)); |
585 | 585 |
586 system_service->file_system()->ReadDirectoryByPath( | 586 system_service->file_system()->ReadDirectoryByPath( |
587 root_path, | 587 root_path, |
588 base::Bind(&DriveInternalsWebUIHandler::OnReadDirectoryByPath, | 588 base::Bind(&DriveInternalsWebUIHandler::OnReadDirectoryByPath, |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); | 740 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); |
741 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); | 741 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); |
742 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); | 742 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); |
743 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); | 743 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); |
744 | 744 |
745 Profile* profile = Profile::FromWebUI(web_ui); | 745 Profile* profile = Profile::FromWebUI(web_ui); |
746 content::WebUIDataSource::Add(profile, source); | 746 content::WebUIDataSource::Add(profile, source); |
747 } | 747 } |
748 | 748 |
749 } // namespace chromeos | 749 } // namespace chromeos |
OLD | NEW |