Chromium Code Reviews| 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 storage id. It will use the transient ID. | 19 // The unique storage id. It will use the transient ID. |
| 20 DOMString id; | 20 DOMString id; |
| 21 // The name of the storage unit. | 21 // The name of the storage unit. |
| 22 DOMString name; | 22 DOMString name; |
| 23 // The media type of the storage unit. | 23 // The media type of the storage unit. |
| 24 StorageUnitType type; | 24 StorageUnitType type; |
| 25 // 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. | 26 // Default value is 0 if query operation fails. |
| 27 double capacity; | 27 double capacity; |
| 28 // The available amount of the storage space, in bytes. | |
| 29 // Default value is 0 if query operation fails. | |
| 30 double availableCapacity; | |
| 31 }; | 28 }; |
| 32 | 29 |
| 33 [inline_doc] enum EjectDeviceResultCode { | 30 [inline_doc] enum EjectDeviceResultCode { |
| 34 // The ejection command is successful -- the application can prompt the user | 31 // The ejection command is successful -- the application can prompt the user |
| 35 // to remove the device. | 32 // to remove the device. |
| 36 success, | 33 success, |
| 37 // The device is in use by another application. The ejection did not | 34 // The device is in use by another application. The ejection did not |
| 38 // succeed; the user should not remove the device until the other | 35 // succeed; the user should not remove the device until the other |
| 39 // application is done with the device. | 36 // application is done with the device. |
| 40 in_use, | 37 in_use, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 // Get all the watched storage devices. | 83 // Get all the watched storage devices. |
| 87 static void getAllWatch(GetAllWatchCallback callback); | 84 static void getAllWatch(GetAllWatchCallback callback); |
| 88 | 85 |
| 89 // Remove all the storage devices monitors. | 86 // Remove all the storage devices monitors. |
| 90 static void removeAllWatch(); | 87 static void removeAllWatch(); |
| 91 }; | 88 }; |
| 92 | 89 |
| 93 interface Events { | 90 interface Events { |
| 94 // Fired when the storage device available capacity is changed. | 91 // Fired when the storage device available capacity is changed. |
| 95 // |info|: The changed information for the specified storage unit. | 92 // |info|: The changed information for the specified storage unit. |
| 96 static void onAvailableCapacityChanged(StorageFreeSpaceChangeInfo info); | 93 static void onAvailableCapacityChanged(StorageFreeSpaceChangeInfo info); |
|
not at google - send to devlin
2013/07/25 14:34:02
what about this event?
| |
| 97 | 94 |
| 98 // Fired when a new removable storage is attached to the system. | 95 // Fired when a new removable storage is attached to the system. |
| 99 static void onAttached(StorageUnitInfo info); | 96 static void onAttached(StorageUnitInfo info); |
| 100 | 97 |
| 101 // Fired when a removable storage is detached from the system. | 98 // Fired when a removable storage is detached from the system. |
| 102 static void onDetached(DOMString id); | 99 static void onDetached(DOMString id); |
| 103 }; | 100 }; |
| 104 | 101 |
| 105 }; | 102 }; |
| 106 | 103 |
| OLD | NEW |