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

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: 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
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 477586421981308a34a8f108580ed9e0b5e26f0c..95ef6e3af2d9ec1437f062a20ac64aa49f1eb92f 100644
--- a/chrome/browser/chromeos/extensions/file_manager/event_router.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/event_router.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/chromeos/extensions/file_manager/fileapi_util.h"
#include "chrome/browser/chromeos/extensions/file_manager/mounted_disk_monitor.h"
#include "chrome/browser/chromeos/extensions/file_manager/open_util.h"
+#include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h"
#include "chrome/browser/chromeos/extensions/file_manager/volume_manager.h"
#include "chrome/browser/chromeos/login/login_display_host_impl.h"
#include "chrome/browser/chromeos/login/screen_locker.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::VolumeTypeToString(VOLUME_TYPE_REMOVABLE_DISK_PARTITION);
+ case chromeos::MOUNT_TYPE_ARCHIVE:
+ return util::VolumeTypeToString(VOLUME_TYPE_MOUNTED_ARCHIVE_FILE);
+ case chromeos::MOUNT_TYPE_GOOGLE_DRIVE:
+ return util::VolumeTypeToString(VOLUME_TYPE_GOOGLE_DRIVE);
+ }
+ NOTREACHED();
+ return "";
+}
+
} // namespace
// Pass dummy value to JobInfo's constructor for make it default constructible.
@@ -703,8 +721,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);

Powered by Google App Engine
This is Rietveld 408576698