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/files/file_enumerator.h" | 8 #include "base/files/file_enumerator.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 if (status != google_apis::HTTP_SUCCESS) { | 315 if (status != google_apis::HTTP_SUCCESS) { |
316 LOG(ERROR) << "Failed to get about resource"; | 316 LOG(ERROR) << "Failed to get about resource"; |
317 return; | 317 return; |
318 } | 318 } |
319 DCHECK(parsed_about_resource); | 319 DCHECK(parsed_about_resource); |
320 | 320 |
321 base::DictionaryValue about_resource; | 321 base::DictionaryValue about_resource; |
322 about_resource.SetDouble("account-quota-total", | 322 about_resource.SetDouble("account-quota-total", |
323 parsed_about_resource->quota_bytes_total()); | 323 parsed_about_resource->quota_bytes_total()); |
324 about_resource.SetDouble("account-quota-used", | 324 about_resource.SetDouble("account-quota-used", |
325 parsed_about_resource->quota_bytes_used()); | 325 parsed_about_resource->quota_bytes_used_aggregate()); |
326 about_resource.SetDouble("account-largest-changestamp-remote", | 326 about_resource.SetDouble("account-largest-changestamp-remote", |
327 parsed_about_resource->largest_change_id()); | 327 parsed_about_resource->largest_change_id()); |
328 about_resource.SetString("root-resource-id", | 328 about_resource.SetString("root-resource-id", |
329 parsed_about_resource->root_folder_id()); | 329 parsed_about_resource->root_folder_id()); |
330 | 330 |
331 web_ui()->CallJavascriptFunction("updateAboutResource", about_resource); | 331 web_ui()->CallJavascriptFunction("updateAboutResource", about_resource); |
332 } | 332 } |
333 | 333 |
334 void DriveInternalsWebUIHandler::OnGetAppList( | 334 void DriveInternalsWebUIHandler::OnGetAppList( |
335 google_apis::DriveApiErrorCode status, | 335 google_apis::DriveApiErrorCode status, |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); | 893 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); |
894 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); | 894 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); |
895 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); | 895 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); |
896 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); | 896 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); |
897 | 897 |
898 Profile* profile = Profile::FromWebUI(web_ui); | 898 Profile* profile = Profile::FromWebUI(web_ui); |
899 content::WebUIDataSource::Add(profile, source); | 899 content::WebUIDataSource::Add(profile, source); |
900 } | 900 } |
901 | 901 |
902 } // namespace chromeos | 902 } // namespace chromeos |
OLD | NEW |