summaryrefslogtreecommitdiffstats
path: root/chromeos/disks
diff options
context:
space:
mode:
authorkmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 05:27:43 +0000
committerkmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 05:27:43 +0000
commit3f005c228392762826a6ab1aaafe6dd31d31518d (patch)
tree38a84dbd97389cd2bf47912feb9df3358976afe7 /chromeos/disks
parent643d544c3d07c78eef785ff5741ad5be54b99b6c (diff)
downloadchromium_src-3f005c228392762826a6ab1aaafe6dd31d31518d.zip
chromium_src-3f005c228392762826a6ab1aaafe6dd31d31518d.tar.gz
chromium_src-3f005c228392762826a6ab1aaafe6dd31d31518d.tar.bz2
[Media Gallery][ChromeOS] Improve device media gallery names.
(1) When a SD card is attached, report a more generic string like "SD card" on the media permissions dialog. (2) When the attached device is not a SD card or when a sub folder of the device is selected as a media gallery, report the gallery name in the following format: <Device_storage_size> <Selected_sub_folder_gallery_name> <Volume_Name> <(Vendor_Name, Model_Name)> Sample gallery names: (1) 1GB TEST_USB (2) 4GB DCIM - RED_USB (3) 8KB PHOTOS - (TESTCOMPANY, A101) (4) 4GB SD Card (5) 16MB SD Card BUG=159671,158600 TEST=none Review URL: https://chromiumcodereview.appspot.com/11366144 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167606 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/disks')
-rw-r--r--chromeos/disks/mock_disk_mount_manager.cc14
-rw-r--r--chromeos/disks/mock_disk_mount_manager.h7
2 files changed, 15 insertions, 6 deletions
diff --git a/chromeos/disks/mock_disk_mount_manager.cc b/chromeos/disks/mock_disk_mount_manager.cc
index 9b6171e..9d6f32d 100644
--- a/chromeos/disks/mock_disk_mount_manager.cc
+++ b/chromeos/disks/mock_disk_mount_manager.cc
@@ -183,7 +183,11 @@ void MockDiskMountManager::SetupDefaultReplies() {
void MockDiskMountManager::CreateDiskEntryForMountDevice(
const DiskMountManager::MountPointInfo& mount_info,
const std::string& device_id,
- const std::string& device_label) {
+ const std::string& device_label,
+ const std::string& vendor_name,
+ const std::string& product_name,
+ DeviceType device_type,
+ uint64 total_size_in_bytes) {
Disk* disk = new DiskMountManager::Disk(std::string(mount_info.source_path),
std::string(mount_info.mount_path),
std::string(), // system_path
@@ -191,13 +195,13 @@ void MockDiskMountManager::CreateDiskEntryForMountDevice(
device_label, // device_label
std::string(), // drive_label
std::string(), // vendor_id
- std::string(), // vendor_name
+ vendor_name,
std::string(), // product_id
- std::string(), // product_name
+ product_name,
device_id, // fs_uuid
std::string(), // system_path_prefix
- DEVICE_TYPE_USB, // device_type
- 1073741824, // total_size_in_bytes
+ device_type,
+ total_size_in_bytes,
false, // is_parent
false, // is_read_only
true, // has_media
diff --git a/chromeos/disks/mock_disk_mount_manager.h b/chromeos/disks/mock_disk_mount_manager.h
index e6b8e89..28ce80d 100644
--- a/chromeos/disks/mock_disk_mount_manager.h
+++ b/chromeos/disks/mock_disk_mount_manager.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/observer_list.h"
+#include "chromeos/dbus/cros_disks_client.h"
#include "chromeos/disks/disk_mount_manager.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -52,7 +53,11 @@ class MockDiskMountManager : public DiskMountManager {
void CreateDiskEntryForMountDevice(
const DiskMountManager::MountPointInfo& mount_info,
const std::string& device_id,
- const std::string& device_label);
+ const std::string& device_label,
+ const std::string& vendor_name,
+ const std::string& product_name,
+ DeviceType device_type,
+ uint64 total_size_in_bytes);
// Removes the fake disk entry associated with the mounted device. This
// function is primarily for RemovableDeviceNotificationsTest.