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

Unified Diff: chrome/browser/storage_monitor/storage_monitor_chromeos.cc

Issue 12544005: Consolidate storage_monitor/MediaDeviceNotificationsUtils into MediaStorageUtil. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another chromeos fix Created 7 years, 9 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/storage_monitor/storage_monitor_chromeos.cc
diff --git a/chrome/browser/storage_monitor/storage_monitor_chromeos.cc b/chrome/browser/storage_monitor/storage_monitor_chromeos.cc
index 59e7ef94f34a6de9dec9859a1c066374a62f08c1..5a37ce29d38b08a96bba471b53a53f5edea8048c 100644
--- a/chrome/browser/storage_monitor/storage_monitor_chromeos.cc
+++ b/chrome/browser/storage_monitor/storage_monitor_chromeos.cc
@@ -12,7 +12,6 @@
#include "base/string_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/storage_monitor/media_device_notifications_utils.h"
#include "chrome/browser/storage_monitor/media_storage_util.h"
#include "chrome/browser/storage_monitor/removable_device_constants.h"
#include "content/public/browser/browser_thread.h"
@@ -38,7 +37,8 @@ string16 GetDeviceName(const disks::DiskMountManager::Disk& disk) {
const std::string& device_label = disk.device_label();
if (!device_label.empty() && IsStringUTF8(device_label))
return UTF8ToUTF16(device_label);
- return chrome::GetFullProductName(disk.vendor_name(), disk.product_name());
+ return chrome::MediaStorageUtil::GetFullProductName(disk.vendor_name(),
+ disk.product_name());
}
// Constructs a device id using uuid or manufacturer (vendor and product) id
@@ -85,6 +85,7 @@ bool GetDeviceInfo(const std::string& source_path,
} // namespace
using content::BrowserThread;
+using chrome::StorageInfo;
StorageMonitorCros::StorageMonitorCros() {
DCHECK(disks::DiskMountManager::GetInstance());
@@ -169,7 +170,7 @@ void StorageMonitorCros::OnFormatEvent(
bool StorageMonitorCros::GetStorageInfoForPath(
const base::FilePath& path,
- chrome::StorageInfo* device_info) const {
+ StorageInfo* device_info) const {
if (!path.IsAbsolute())
return false;
@@ -199,7 +200,7 @@ void StorageMonitorCros::CheckMountedPathOnFileThread(
const disks::DiskMountManager::MountPointInfo& mount_info) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- bool has_dcim = chrome::IsMediaDevice(mount_info.mount_path);
+ bool has_dcim = chrome::MediaStorageUtil::HasDcim(mount_info.mount_path);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
@@ -240,14 +241,17 @@ void StorageMonitorCros::AddMountedPathOnUIThread(
std::string device_id = chrome::MediaStorageUtil::MakeDeviceId(type,
unique_id);
StorageObjectInfo object_info = {
- chrome::StorageInfo(device_id, device_label, mount_info.mount_path),
+ StorageInfo(device_id, device_label, mount_info.mount_path),
storage_size_in_bytes
};
mount_map_.insert(std::make_pair(mount_info.mount_path, object_info));
- receiver()->ProcessAttach(chrome::StorageInfo(
- device_id,
- chrome::GetDisplayNameForDevice(storage_size_in_bytes, device_label),
- mount_info.mount_path));
+
+ string16 display_name = chrome::MediaStorageUtil::GetDisplayNameForDevice(
+ storage_size_in_bytes,
+ device_label);
+
+ StorageInfo storage_info(device_id, display_name, mount_info.mount_path);
+ receiver()->ProcessAttach(storage_info);
}
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698