Index: chrome/common/extensions/api/system_info_storage.idl |
diff --git a/chrome/common/extensions/api/system_info_storage.idl b/chrome/common/extensions/api/system_info_storage.idl |
new file mode 100644 |
index 0000000000000000000000000000000000000000..aa7819ec38770eadbc4df8c49246bea11afb8c94 |
--- /dev/null |
+++ b/chrome/common/extensions/api/system_info_storage.idl |
@@ -0,0 +1,47 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Use the <code>chrome.systemInfo.storage</code> API to query |
+// 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.
|
+namespace systemInfo.storage { |
+ |
+ enum StorageUnitType { |
+ // The storage has fixed media, e.g. hard disk or SSD. |
+ fixed, |
+ // The storage is removable, e.g. USB flash drive. |
+ removable, |
+ // The storage type is unknown. |
+ unknown |
+ }; |
+ |
+ dictionary StorageUnitInfo { |
+ // The unique storage id. It will use the transient ID. |
+ DOMString id; |
+ // The name of the storage unit. |
+ DOMString name; |
+ // The media type of the storage unit. |
+ StorageUnitType type; |
+ // The total amount of the storage space, in bytes. |
+ // 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.
|
+ double capacity; |
+ }; |
+ |
+ callback StorageInfoCallback = void (StorageUnitInfo[] info); |
+ |
+ interface Functions { |
+ // Get the storage information from the system. The argument passed to the |
+ // callback is an array of StorageUnitInfo objects. |
+ static void get(StorageInfoCallback callback); |
+ }; |
+ |
+ interface Events { |
+ // Fired when a new removable storage is attached to the system. |
+ static void onAttached(StorageUnitInfo info); |
+ |
+ // Fired when a removable storage is detached from the system. |
+ static void onDetached(DOMString id); |
+ }; |
+ |
+}; |
+ |