Chromium Code Reviews| 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 // Use the <code>chrome.systemInfo.storage</code> API to query | |
| 6 // storage device information and be notified when it changes. | |
|
Hongbo Min
2013/07/08 06:52:43
nit: ... and be notified when a storage device is
Haojian Wu
2013/07/08 07:46:30
Done.
| |
| 7 namespace systemInfo.storage { | |
| 8 | |
| 9 enum StorageUnitType { | |
| 10 // The storage has fixed media, e.g. hard disk or SSD. | |
| 11 fixed, | |
| 12 // The storage is removable, e.g. USB flash drive. | |
| 13 removable, | |
| 14 // The storage type is unknown. | |
| 15 unknown | |
| 16 }; | |
| 17 | |
| 18 dictionary StorageUnitInfo { | |
| 19 // The unique storage id. It will use the transient ID. | |
| 20 DOMString id; | |
| 21 // The name of the storage unit. | |
| 22 DOMString name; | |
| 23 // The media type of the storage unit. | |
| 24 StorageUnitType type; | |
| 25 // The total amount of the storage space, in bytes. | |
| 26 // Default value is 0 if query operation fails. | |
|
Hongbo Min
2013/07/08 06:52:43
Seems the description of "Default value is 0 if qu
Haojian Wu
2013/07/08 07:46:30
Yes, I think so. Done.
| |
| 27 double capacity; | |
| 28 }; | |
| 29 | |
| 30 callback StorageInfoCallback = void (StorageUnitInfo[] info); | |
| 31 | |
| 32 interface Functions { | |
| 33 // Get the storage information from the system. The argument passed to the | |
| 34 // callback is an array of StorageUnitInfo objects. | |
| 35 static void get(StorageInfoCallback callback); | |
| 36 }; | |
| 37 | |
| 38 interface Events { | |
| 39 // Fired when a new removable storage is attached to the system. | |
| 40 static void onAttached(StorageUnitInfo info); | |
| 41 | |
| 42 // Fired when a removable storage is detached from the system. | |
| 43 static void onDetached(DOMString id); | |
| 44 }; | |
| 45 | |
| 46 }; | |
| 47 | |
| OLD | NEW |