OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 namespace experimental.systemInfo.storage { | |
6 | |
7 enum StorageUnitType { | |
8 // Unknow storage type. | |
9 unknown, | |
10 // Hard disk. | |
11 harddisk, | |
12 // Removable storage, e.g.USB device. | |
13 removable | |
14 }; | |
15 | |
16 dictionary StorageUnitInfo { | |
17 // The unique id of the storage unit. | |
18 DOMString id; | |
19 // The type of storage device. The value is one of the constants defined | |
20 // for this type. | |
21 StorageUnitType type; | |
22 // The total amount of the storage space, in bytes. | |
23 double capacity; | |
24 // The available amount of the storage space, in bytes. | |
25 double availableCapacity; | |
26 }; | |
27 | |
28 dictionary StorageInfo { | |
29 // The array of storage units connected to the system. | |
30 StorageUnitInfo[] units; | |
31 }; | |
32 | |
33 dictionary StorageUnitChangeInfo { | |
34 // The unique ID of storage unit on which the change is taken place. | |
35 DOMString id; | |
36 // The changed availableCapacity attribute. | |
37 double availableCapacity; | |
38 }; | |
39 | |
40 callback StorageInfoCallback = void (StorageInfo info); | |
41 callback StorageUnitChangeCallback = void (StorageUnitChangeInfo unit); | |
42 | |
43 interface Functions { | |
44 // Get the storage information from the system. | |
45 static void get(StorageInfoCallback callback); | |
46 }; | |
47 | |
48 interface Events { | |
Mihai Parparita -not on Chrome
2012/08/14 00:07:31
Remove unused parts of the IDL.
Hongbo Min
2012/08/14 01:37:23
Done.
| |
49 // Fired when the specified storage unit information is updated. | |
50 // |info| : The changed information for the specified storage unit. | |
51 static void onChanged(StorageUnitChangeInfo info); | |
52 | |
53 // Fired when a new storage unit is added to the system, | |
54 // i.e. a new USB disk is plugged in. | |
55 // |unit| : The information of the new storage unit. | |
56 static void onAdded(StorageUnitInfo unit); | |
57 | |
58 // Fired when a storage unit is removed from the system | |
59 // i.e. a USB disk is unplugged. | |
60 // |id| : The unique ID of storage unit already removed. | |
61 static void onRemoved(DOMString id); | |
62 }; | |
63 }; | |
64 | |
OLD | NEW |