1 // Copyright 2018 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // StorageInfoUtil provides some general functions to get information
6 // from device::mojom::MtpStorageInfo needed by storage_monitor::StorageInfo.
8 #ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_INFO_UTILS_H_
9 #define COMPONENTS_STORAGE_MONITOR_STORAGE_INFO_UTILS_H_
13 #include "services/device/public/mojom/mtp_storage_info.mojom.h"
15 namespace storage_monitor {
17 // Constructs and returns the location of the device using the |storage_name|.
18 std::string GetDeviceLocationFromStorageName(const std::string& storage_name);
20 // Returns a unique device id from the given |storage_info|.
21 std::string GetDeviceIdFromStorageInfo(
22 const device::mojom::MtpStorageInfo& storage_info);
24 // Helper function to get device label from storage information.
25 std::u16string GetDeviceLabelFromStorageInfo(
26 const device::mojom::MtpStorageInfo& storage_info);
28 } // namespace storage_monitor
30 #endif // COMPONENTS_STORAGE_MONITOR_STORAGE_INFO_UTILS_H_