Index: chrome/browser/chromeos/file_manager/volume_manager.cc |
diff --git a/chrome/browser/chromeos/file_manager/volume_manager.cc b/chrome/browser/chromeos/file_manager/volume_manager.cc |
index 63b2d76d33ac567a20b902b52a2bcb0f11061d3e..f1bc9ecb47f1645cf45d10ee1f9e880d321d0b28 100644 |
--- a/chrome/browser/chromeos/file_manager/volume_manager.cc |
+++ b/chrome/browser/chromeos/file_manager/volume_manager.cc |
@@ -7,6 +7,7 @@ |
#include "base/basictypes.h" |
#include "base/bind.h" |
#include "base/callback.h" |
+#include "base/command_line.h" |
#include "base/files/file_path.h" |
#include "base/logging.h" |
#include "base/memory/singleton.h" |
@@ -19,7 +20,9 @@ |
#include "chrome/browser/chromeos/file_manager/path_util.h" |
#include "chrome/browser/chromeos/file_manager/volume_manager_factory.h" |
#include "chrome/browser/chromeos/file_manager/volume_manager_observer.h" |
+#include "chrome/browser/local_discovery/storage/privet_filesystem_constants.h" |
#include "chrome/browser/profiles/profile.h" |
+#include "chrome/common/chrome_switches.h" |
#include "chrome/common/pref_names.h" |
#include "chromeos/dbus/cros_disks_client.h" |
#include "chromeos/disks/disk_mount_manager.h" |
@@ -63,6 +66,8 @@ std::string VolumeTypeToString(VolumeType type) { |
return "removable"; |
case VOLUME_TYPE_MOUNTED_ARCHIVE_FILE: |
return "archive"; |
+ case VOLUME_TYPE_PRIVET: |
+ return "privet"; |
} |
NOTREACHED(); |
return ""; |
@@ -131,6 +136,17 @@ VolumeInfo CreateVolumeInfoFromMountPointInfo( |
return volume_info; |
} |
+VolumeInfo CreatePrivetVolumeInfo() { |
mtomasz
2014/01/08 09:35:24
Note, that in late M-34/early M-35 we will have a
Noam Samuel
2014/01/09 01:00:10
Agreed. This code should eventually be in JS.
|
+ VolumeInfo volume_info; |
+ volume_info.type = VOLUME_TYPE_PRIVET; |
+ volume_info.mount_path = base::FilePath(local_discovery::kPrivetFilePath); |
+ volume_info.mount_condition = chromeos::disks::MOUNT_CONDITION_NONE; |
+ volume_info.is_parent = true; |
+ volume_info.is_read_only = true; |
+ volume_info.volume_id = GenerateVolumeId(volume_info); |
+ return volume_info; |
+} |
+ |
} // namespace |
VolumeInfo::VolumeInfo() { |
@@ -256,6 +272,11 @@ std::vector<VolumeInfo> VolumeManager::GetVolumeInfoList() const { |
disk_mount_manager_->FindDiskBySourcePath(it->second.source_path))); |
} |
+ if (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnablePrivetStorage)) { |
+ result.push_back(CreatePrivetVolumeInfo()); |
+ } |
+ |
return result; |
} |