Commit a3b92e56 authored by tbarzic@chromium.org's avatar tbarzic@chromium.org

Show only one error notification per inserted mulitpartitioned usb card.

iWe should use system path of the device that contains partitions block device, instead partitions system path as notifications identification path.

e.g.
/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-6/1-6:1.0/host9/target9:0:0/9:0:0:0
instead of
/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-6/1-6:1.0/host9/target9:0:0/9:0:0:0/block/sdb/sdb9

TEST=Manual on Cr48 (tried multiple-partitioned device with no good partitions, with one good-partition, device with one partition)
BUG=chromium-os:19559


Review URL: http://codereview.chromium.org/7748003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98292 0039d316-1c4b-4281-b951-d872f2087c98
parent 2d181627
...@@ -210,12 +210,15 @@ void ExtensionFileBrowserEventRouter::MountCompleted( ...@@ -210,12 +210,15 @@ void ExtensionFileBrowserEventRouter::MountCompleted(
chromeos::MountLibrary::Disk* disk = chromeos::MountLibrary::Disk* disk =
mount_lib->disks().find(mount_info.source_path)->second; mount_lib->disks().find(mount_info.source_path)->second;
std::string notification_sys_path =
disk->system_path().substr(0, disk->system_path().rfind("/block"));
if (!error_code) { if (!error_code) {
HideFileBrowserNotification("MOUNT", disk->system_path()); HideFileBrowserNotification("MOUNT", disk->system_path());
} else { } else {
HideFileBrowserNotification("MOUNT", disk->system_path()); HideFileBrowserNotification("MOUNT", disk->system_path());
if (!disk->drive_label().empty()) { if (!disk->drive_label().empty()) {
ShowFileBrowserNotification("MOUNT", disk->system_path(), ShowFileBrowserNotification("MOUNT", notification_sys_path,
IDR_PAGEINFO_INFO, IDR_PAGEINFO_INFO,
l10n_util::GetStringUTF16(IDS_REMOVABLE_DEVICE_DETECTION_TITLE), l10n_util::GetStringUTF16(IDS_REMOVABLE_DEVICE_DETECTION_TITLE),
// TODO(tbarzic): Find more suitable message. // TODO(tbarzic): Find more suitable message.
...@@ -224,7 +227,7 @@ void ExtensionFileBrowserEventRouter::MountCompleted( ...@@ -224,7 +227,7 @@ void ExtensionFileBrowserEventRouter::MountCompleted(
ASCIIToUTF16(disk->drive_label()), ASCIIToUTF16(disk->drive_label()),
ASCIIToUTF16(MountErrorToString(error_code)))); ASCIIToUTF16(MountErrorToString(error_code))));
} else { } else {
ShowFileBrowserNotification("MOUNT", disk->system_path(), ShowFileBrowserNotification("MOUNT", notification_sys_path,
IDR_PAGEINFO_INFO, IDR_PAGEINFO_INFO,
l10n_util::GetStringUTF16(IDS_REMOVABLE_DEVICE_DETECTION_TITLE), l10n_util::GetStringUTF16(IDS_REMOVABLE_DEVICE_DETECTION_TITLE),
// TODO(tbarzic): Find more suitable message. // TODO(tbarzic): Find more suitable message.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment