Files.app: Add NO_SERVER_SPACE sync error message.
BUG=339700
TEST=None
Review URL: https://codereview.chromium.org/1336503002
Cr-Commit-Position: refs/heads/master@{#348572}
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp
index a100a2f..53d37bf 100644
--- a/chrome/app/chromeos_strings.grdp
+++ b/chrome/app/chromeos_strings.grdp
@@ -588,6 +588,9 @@
<message name="IDS_FILE_BROWSER_SYNC_MISC_ERROR" desc="File Manager status message shown when the drive sync is failed because of miscellaneous errors.">
Google Drive was unable to sync "<ph name="FILENAME">$1<ex>photo.jpg</ex></ph>" right now. Google Drive will try again later.
</message>
+ <message name="IDS_FILE_BROWSER_SYNC_NO_SERVER_SPACE" desc="File Manager status message shown when the drive sync is failed because it runs out the space in Google Drive server.">
+ "<ph name="FILENAME">$1<ex>photo.jpg</ex></ph>" was not uploaded. There is not enough free space in your Google Drive.
+ </message>
<message name="IDS_FILE_BROWSER_SHARE_ERROR" desc="File Manager error message when sharing a file or a directory on Drive fails because of internet connection problems.">
Sharing failed. Check your connection and try again later.
</message>
diff --git a/chrome/browser/chromeos/extensions/file_manager/event_router.cc b/chrome/browser/chromeos/extensions/file_manager/event_router.cc
index 3275ae3..a0afd3c 100644
--- a/chrome/browser/chromeos/extensions/file_manager/event_router.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/event_router.cc
@@ -691,6 +691,9 @@
event.type =
file_manager_private::DRIVE_SYNC_ERROR_TYPE_SERVICE_UNAVAILABLE;
break;
+ case drive::file_system::DRIVE_SYNC_ERROR_NO_SERVER_SPACE:
+ event.type = file_manager_private::DRIVE_SYNC_ERROR_TYPE_NO_SERVER_SPACE;
+ break;
case drive::file_system::DRIVE_SYNC_ERROR_MISC:
event.type =
file_manager_private::DRIVE_SYNC_ERROR_TYPE_MISC;
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_strings.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_strings.cc
index 32ee556..04ba9b3 100644
--- a/chrome/browser/chromeos/extensions/file_manager/private_api_strings.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/private_api_strings.cc
@@ -148,6 +148,7 @@
SET_STRING("SYNC_FILE_NAME", IDS_FILE_BROWSER_SYNC_FILE_NAME);
SET_STRING("SYNC_FILE_NUMBER", IDS_FILE_BROWSER_SYNC_FILE_NUMBER);
SET_STRING("SYNC_MISC_ERROR", IDS_FILE_BROWSER_SYNC_MISC_ERROR);
+ SET_STRING("SYNC_NO_SERVER_SPACE", IDS_FILE_BROWSER_SYNC_NO_SERVER_SPACE);
SET_STRING("SYNC_PROGRESS_SUMMARY", IDS_FILE_BROWSER_SYNC_PROGRESS_SUMMARY);
SET_STRING("SYNC_SERVICE_UNAVAILABLE_ERROR",
IDS_FILE_BROWSER_SYNC_SERVICE_UNAVAILABLE_ERROR);
diff --git a/chrome/common/extensions/api/file_manager_private.idl b/chrome/common/extensions/api/file_manager_private.idl
index bae25f9..bf636a56 100644
--- a/chrome/common/extensions/api/file_manager_private.idl
+++ b/chrome/common/extensions/api/file_manager_private.idl
@@ -122,6 +122,8 @@
delete_without_permission,
// Google Drive is temporarily unavailable.
service_unavailable,
+ // There is no server space to sync a file.
+ no_server_space,
// Miscellaneous errors other than listed above.
misc
};
diff --git a/components/drive/file_system/operation_delegate.h b/components/drive/file_system/operation_delegate.h
index 24f50a8..ec1de18 100644
--- a/components/drive/file_system/operation_delegate.h
+++ b/components/drive/file_system/operation_delegate.h
@@ -25,6 +25,8 @@
DRIVE_SYNC_ERROR_DELETE_WITHOUT_PERMISSION,
// Google Drive is temporary unavailable.
DRIVE_SYNC_ERROR_SERVICE_UNAVAILABLE,
+ // There is no server space to sync a file.
+ DRIVE_SYNC_ERROR_NO_SERVER_SPACE,
// Errors other than above ones. No fallback is provided for the error.
DRIVE_SYNC_ERROR_MISC,
};
diff --git a/components/drive/sync_client.cc b/components/drive/sync_client.cc
index e11a6ce..0b27928b 100644
--- a/components/drive/sync_client.cc
+++ b/components/drive/sync_client.cc
@@ -442,6 +442,10 @@
operation_delegate_->OnDriveSyncError(
file_system::DRIVE_SYNC_ERROR_SERVICE_UNAVAILABLE, local_id);
break;
+ case FILE_ERROR_NO_SERVER_SPACE:
+ operation_delegate_->OnDriveSyncError(
+ file_system::DRIVE_SYNC_ERROR_NO_SERVER_SPACE, local_id);
+ break;
default:
operation_delegate_->OnDriveSyncError(
file_system::DRIVE_SYNC_ERROR_MISC, local_id);
diff --git a/ui/file_manager/file_manager/background/js/drive_sync_handler.js b/ui/file_manager/file_manager/background/js/drive_sync_handler.js
index 316a95d1..517b7f8 100644
--- a/ui/file_manager/file_manager/background/js/drive_sync_handler.js
+++ b/ui/file_manager/file_manager/background/js/drive_sync_handler.js
@@ -228,6 +228,9 @@
case 'service_unavailable':
item.message = str('SYNC_SERVICE_UNAVAILABLE_ERROR');
break;
+ case 'no_server_space':
+ item.message = strf('SYNC_NO_SERVER_SPACE', entry.name);
+ break;
case 'misc':
item.message = strf('SYNC_MISC_ERROR', entry.name);
break;