storage_info_utils.h 1.1 KB

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