Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: chrome/browser/ui/webui/chromeos/drive_internals_ui.cc

Issue 1125123008: Files.app: Use quotaBytesUsedAggregate to know the actual available space. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/drive/fake_drive_service.cc ('k') | chrome/test/data/drive/about.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/drive/fake_drive_service.cc ('k') | chrome/test/data/drive/about.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698