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

Unified Diff: chrome/browser/chromeos/extensions/file_manager/event_router.cc

Issue 137903002: Files.app: Add a drive sync error event to the fileBrowserPrivate API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/extensions/file_manager/event_router.cc
diff --git a/chrome/browser/chromeos/extensions/file_manager/event_router.cc b/chrome/browser/chromeos/extensions/file_manager/event_router.cc
index 611470c2c8c4661380df0e272b215342d81f9d45..293db021a2a5dad7ccfc4690e61f6a3494561258 100644
--- a/chrome/browser/chromeos/extensions/file_manager/event_router.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/event_router.cc
@@ -563,6 +563,23 @@ void EventRouter::OnDirectoryChanged(const base::FilePath& directory_path) {
HandleFileWatchNotification(directory_path, false);
}
+void EventRouter::OnDriveSyncError(
+ drive::file_system::DriveSyncErrorType type) {
+ file_browser_private::DriveSyncErrorEvent event;
+ switch (type) {
+ case drive::file_system::DELETE_WITHOUT_PERMISSION:
+ event.type =
+ file_browser_private::DRIVE_SYNC_ERROR_TYPE_DELETE_WITHOUT_PERMISSION;
+ break;
+ default:
hashimoto 2014/01/15 07:05:06 nit: Having "default" will prevent the compiler fr
hirono 2014/01/15 10:40:51 Done.
+ NOTREACHED();
+ }
+ BroadcastEvent(
+ profile_,
+ file_browser_private::OnDriveSyncError::kEventName,
+ file_browser_private::OnDriveSyncError::Create(event));
+}
+
void EventRouter::OnRefreshTokenInvalid() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));

Powered by Google App Engine
This is Rietveld 408576698