Commit ccd06532 authored by fukino's avatar fukino Committed by Commit bot

Files.app: Tell users that the remaining space is 0 bytes when Drive usage is over quota.

BUG=459871
TEST=manually confirm that the remaining space shown on the bannar and the gear
menu is 0 bytes when Drive usage is over quota.

Review URL: https://codereview.chromium.org/1147813003

Cr-Commit-Position: refs/heads/master@{#330490}
parent fa171d08
...@@ -430,7 +430,9 @@ void FileManagerPrivateGetSizeStatsFunction::GetDriveAvailableSpaceCallback( ...@@ -430,7 +430,9 @@ void FileManagerPrivateGetSizeStatsFunction::GetDriveAvailableSpaceCallback(
int64 bytes_used) { int64 bytes_used) {
if (error == drive::FILE_ERROR_OK) { if (error == drive::FILE_ERROR_OK) {
const uint64 bytes_total_unsigned = bytes_total; const uint64 bytes_total_unsigned = bytes_total;
const uint64 bytes_remaining_unsigned = bytes_total - bytes_used; // bytes_used can be larger than bytes_total (over quota).
const uint64 bytes_remaining_unsigned =
std::max(bytes_total - bytes_used, int64(0));
GetSizeStatsCallback(&bytes_total_unsigned, GetSizeStatsCallback(&bytes_total_unsigned,
&bytes_remaining_unsigned); &bytes_remaining_unsigned);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment