| 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 namespace experimental.systemInfo.storage { | 5 namespace experimental.systemInfo.storage { |
| 6 | 6 |
| 7 enum StorageUnitType { | 7 enum StorageUnitType { |
| 8 // Unknow storage type. | 8 // Unknow storage type. |
| 9 unknown, | 9 unknown, |
| 10 // Hard disk. | 10 // Hard disk. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 double availableCapacity; | 25 double availableCapacity; |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 dictionary StorageChangeInfo { | 28 dictionary StorageChangeInfo { |
| 29 // The uniue id of the storage unit already changed. | 29 // The uniue id of the storage unit already changed. |
| 30 DOMString id; | 30 DOMString id; |
| 31 // The new value of the available capacity. | 31 // The new value of the available capacity. |
| 32 double availableCapacity; | 32 double availableCapacity; |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 // A dictionary that describes the add particular storage device watch |
| 36 // request results. |
| 37 dictionary AddWatchResult { |
| 38 DOMString id; |
| 39 boolean success; |
| 40 }; |
| 41 |
| 35 callback StorageInfoCallback = void (StorageUnitInfo[] info); | 42 callback StorageInfoCallback = void (StorageUnitInfo[] info); |
| 36 | 43 |
| 44 callback AddWatchCallback = void (AddWatchResult info); |
| 45 |
| 46 callback GetAllWatchCallback = void (DOMString[] storageIds); |
| 47 |
| 37 interface Functions { | 48 interface Functions { |
| 38 // Get the storage information from the system. The argument passed to the | 49 // Get the storage information from the system. The argument passed to the |
| 39 // callback is an array of StorageUnitInfo objects. | 50 // callback is an array of StorageUnitInfo objects. |
| 40 static void get(StorageInfoCallback callback); | 51 static void get(StorageInfoCallback callback); |
| 52 |
| 53 // Monitor a particular storage device available change capacity. |
| 54 static void addWatch(DOMString id, AddWatchCallback callback); |
| 55 |
| 56 // Get all the watched storage devices. |
| 57 static void getAllWatch(GetAllWatchCallback callback); |
| 58 |
| 59 // Remove the monitor of a particular device. |
| 60 static void removeWatch(DOMString id); |
| 61 |
| 62 // Remove all the storage devices monitors. |
| 63 static void removeAllWatch(); |
| 41 }; | 64 }; |
| 42 | 65 |
| 43 interface Events { | 66 interface Events { |
| 44 // Fired when the storage device available capacity is changed. | 67 // Fired when the storage device available capacity is changed. |
| 45 // |info|: The changed information for the specified storage unit. | 68 // |info|: The changed information for the specified storage unit. |
| 46 static void onAvailableCapacityChanged(StorageChangeInfo info); | 69 static void onAvailableCapacityChanged(StorageChangeInfo info); |
| 47 | 70 |
| 48 // Fired when a new removable storage is attached to the system. | 71 // Fired when a new removable storage is attached to the system. |
| 49 static void onAttached(StorageUnitInfo info); | 72 static void onAttached(StorageUnitInfo info); |
| 50 | 73 |
| 51 // Fired when a removable storage is detached from the system. | 74 // Fired when a removable storage is detached from the system. |
| 52 static void onDetached(DOMString id); | 75 static void onDetached(DOMString id); |
| 53 }; | 76 }; |
| 54 | 77 |
| 55 }; | 78 }; |
| 56 | 79 |
| OLD | NEW |