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