#include "components/storage_monitor/storage_info.h"
#include <stddef.h>
#include "base/check_op.h"
#include "base/notreached.h"
#include "base/strings/utf_string_conversions.h"
#include "components/storage_monitor/media_storage_util.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/text/bytes_formatting.h"
namespace {
const char kRemovableMassStorageWithDCIMPrefix[] = …;
const char kRemovableMassStorageNoDCIMPrefix[] = …;
const char kFixedMassStoragePrefix[] = …;
const char kMtpPtpPrefix[] = …;
const char kMacImageCapturePrefix[] = …;
std::u16string GetDisplayNameForDevice(uint64_t storage_size_in_bytes,
const std::u16string& name) { … }
std::u16string GetFullProductName(const std::u16string& vendor_name,
const std::u16string& model_name) { … }
}
namespace storage_monitor {
StorageInfo::StorageInfo() : … { … }
StorageInfo::StorageInfo(const StorageInfo& other) = default;
StorageInfo::StorageInfo(const std::string& device_id_in,
const base::FilePath::StringType& device_location,
const std::u16string& label,
const std::u16string& vendor,
const std::u16string& model,
uint64_t size_in_bytes)
: … { … }
StorageInfo::~StorageInfo() { … }
std::string StorageInfo::MakeDeviceId(Type type, const std::string& unique_id) { … }
bool StorageInfo::CrackDeviceId(const std::string& device_id,
Type* type, std::string* unique_id) { … }
bool StorageInfo::IsMediaDevice(const std::string& device_id) { … }
bool StorageInfo::IsRemovableDevice(const std::string& device_id) { … }
bool StorageInfo::IsMassStorageDevice(const std::string& device_id) { … }
bool StorageInfo::IsMTPDevice(const std::string& device_id) { … }
std::u16string StorageInfo::GetDisplayName(bool with_size) const { … }
std::u16string StorageInfo::GetDisplayNameWithOverride(
const std::u16string& override_display_name,
bool with_size) const { … }
}