| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Use the <code>chrome.experimental.systemInfo.storage</code> API to query | 5 // Use the <code>chrome.experimental.systemInfo.storage</code> API to query |
| 6 // storage device information and be notified when it changes. | 6 // storage device information and be notified when it changes. |
| 7 namespace experimental.systemInfo.storage { | 7 namespace experimental.systemInfo.storage { |
| 8 | 8 |
| 9 enum StorageUnitType { | 9 enum StorageUnitType { |
| 10 // The storage has fixed media, e.g. hard disk or SSD. | 10 // The storage has fixed media, e.g. hard disk or SSD. |
| 11 fixed, | 11 fixed, |
| 12 // The storage is removable, e.g. USB flash drive. | 12 // The storage is removable, e.g. USB flash drive. |
| 13 removable, | 13 removable, |
| 14 // The storage type is unknown. | 14 // The storage type is unknown. |
| 15 unknown | 15 unknown |
| 16 }; | 16 }; |
| 17 | 17 |
| 18 dictionary StorageUnitInfo { | 18 dictionary StorageUnitInfo { |
| 19 // The unique id of the storage unit. | 19 // The unique storage id. It will use the transient ID. |
| 20 DOMString id; | 20 DOMString id; |
| 21 // The name of the storage unit. |
| 22 DOMString name; |
| 21 // The media type of the storage unit. | 23 // The media type of the storage unit. |
| 22 StorageUnitType type; | 24 StorageUnitType type; |
| 23 // The total amount of the storage space, in bytes. | 25 // The total amount of the storage space, in bytes. |
| 26 // Default value is 0 if query operation fails. |
| 24 double capacity; | 27 double capacity; |
| 25 // The available amount of the storage space, in bytes. | 28 // The available amount of the storage space, in bytes. |
| 29 // Default value is 0 if query operation fails. |
| 26 double availableCapacity; | 30 double availableCapacity; |
| 27 }; | 31 }; |
| 28 | 32 |
| 29 dictionary StorageChangeInfo { | 33 dictionary StorageFreeSpaceChangeInfo { |
| 30 // The uniue id of the storage unit already changed. | 34 // The transient id of the storage unit already changed. |
| 31 DOMString id; | 35 DOMString id; |
| 32 // The new value of the available capacity. | 36 // The new value of the available capacity. |
| 33 double availableCapacity; | 37 double availableCapacity; |
| 34 }; | 38 }; |
| 35 | 39 |
| 36 // A dictionary that describes the add particular storage device watch | 40 // A dictionary that describes the add particular storage device watch |
| 37 // request results. | 41 // request results. |
| 38 dictionary AddWatchResult { | 42 dictionary AddWatchResult { |
| 39 DOMString id; | 43 DOMString id; |
| 40 boolean success; | 44 boolean success; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 60 // Get all the watched storage devices. | 64 // Get all the watched storage devices. |
| 61 static void getAllWatch(GetAllWatchCallback callback); | 65 static void getAllWatch(GetAllWatchCallback callback); |
| 62 | 66 |
| 63 // Remove all the storage devices monitors. | 67 // Remove all the storage devices monitors. |
| 64 static void removeAllWatch(); | 68 static void removeAllWatch(); |
| 65 }; | 69 }; |
| 66 | 70 |
| 67 interface Events { | 71 interface Events { |
| 68 // Fired when the storage device available capacity is changed. | 72 // Fired when the storage device available capacity is changed. |
| 69 // |info|: The changed information for the specified storage unit. | 73 // |info|: The changed information for the specified storage unit. |
| 70 static void onAvailableCapacityChanged(StorageChangeInfo info); | 74 static void onAvailableCapacityChanged(StorageFreeSpaceChangeInfo info); |
| 71 | 75 |
| 72 // Fired when a new removable storage is attached to the system. | 76 // Fired when a new removable storage is attached to the system. |
| 73 static void onAttached(StorageUnitInfo info); | 77 static void onAttached(StorageUnitInfo info); |
| 74 | 78 |
| 75 // Fired when a removable storage is detached from the system. | 79 // Fired when a removable storage is detached from the system. |
| 76 static void onDetached(DOMString id); | 80 static void onDetached(DOMString id); |
| 77 }; | 81 }; |
| 78 | 82 |
| 79 }; | 83 }; |
| 80 | 84 |
| OLD | NEW |