summaryrefslogtreecommitdiff
path: root/chromium/components/storage_monitor/storage_info_utils.h
blob: 037937b243c2df40819eb64f69d190a66829ab61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// StorageInfoUtil provides some general functions to get information
// from device::mojom::MtpStorageInfo needed by storage_monitor::StorageInfo.

#ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_INFO_UTILS_H_
#define COMPONENTS_STORAGE_MONITOR_STORAGE_INFO_UTILS_H_

#include <string>

#include "base/strings/string16.h"
#include "services/device/public/mojom/mtp_storage_info.mojom.h"

namespace storage_monitor {

// Constructs and returns the location of the device using the |storage_name|.
std::string GetDeviceLocationFromStorageName(const std::string& storage_name);

// Returns a unique device id from the given |storage_info|.
std::string GetDeviceIdFromStorageInfo(
    const device::mojom::MtpStorageInfo& storage_info);

// Helper function to get device label from storage information.
base::string16 GetDeviceLabelFromStorageInfo(
    const device::mojom::MtpStorageInfo& storage_info);

}  // namespace storage_monitor

#endif  // COMPONENTS_STORAGE_MONITOR_STORAGE_INFO_UTILS_H_