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

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

Issue 23658009: Replace mountType by volumeType on fileBrowserPrivate APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_manager/private_api_mount.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 73b78c4f297f1c982b4afcb7b081969572301ad5..fda7013cb281c10fadf23d3e970fa7f1e9e69cb5 100644
--- a/chrome/browser/chromeos/extensions/file_manager/event_router.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/event_router.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/chromeos/drive/drive_integration_service.h"
#include "chrome/browser/chromeos/drive/file_system_interface.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
+#include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h"
#include "chrome/browser/chromeos/file_manager/app_id.h"
#include "chrome/browser/chromeos/file_manager/desktop_notifications.h"
#include "chrome/browser/chromeos/file_manager/fileapi_util.h"
@@ -209,6 +210,23 @@ bool IsGooglePhotosInstalled(Profile *profile) {
return false;
}
+// This method is temporarily introduced to make a change step by step.
+// After mounting logic is moved to VolumeManager, this should be removed.
+std::string MountTypeToString(chromeos::MountType type) {
+ switch (type) {
+ case chromeos::MOUNT_TYPE_INVALID:
+ return "";
+ case chromeos::MOUNT_TYPE_DEVICE:
+ return util::VolumeTypeToStringEnum(VOLUME_TYPE_REMOVABLE_DISK_PARTITION);
+ case chromeos::MOUNT_TYPE_ARCHIVE:
+ return util::VolumeTypeToStringEnum(VOLUME_TYPE_MOUNTED_ARCHIVE_FILE);
+ case chromeos::MOUNT_TYPE_GOOGLE_DRIVE:
+ return util::VolumeTypeToStringEnum(VOLUME_TYPE_GOOGLE_DRIVE);
+ }
+ NOTREACHED();
+ return "";
+}
+
} // namespace
// Pass dummy value to JobInfo's constructor for make it default constructible.
@@ -690,8 +708,7 @@ void EventRouter::DispatchMountEvent(
event == DiskMountManager::MOUNTING ? "mount" : "unmount");
mount_info_value->SetString("status", MountErrorToString(error_code));
mount_info_value->SetString(
- "mountType",
- DiskMountManager::MountTypeToString(mount_info.mount_type));
+ "volumeType", MountTypeToString(mount_info.mount_type));
// Add sourcePath to the event.
mount_info_value->SetString("sourcePath", mount_info.source_path);
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_manager/private_api_mount.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698