Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3493)

Unified Diff: chrome/common/extensions/api/experimental_systeminfo_storage.idl

Issue 10824232: Add systeminfo.storage API implementation skeleton (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/api/experimental_systeminfo_storage.idl
diff --git a/chrome/common/extensions/api/experimental_systeminfo_storage.idl b/chrome/common/extensions/api/experimental_systeminfo_storage.idl
new file mode 100644
index 0000000000000000000000000000000000000000..456f9f321c8469e6b3b4dccca44e4e814b035d19
--- /dev/null
+++ b/chrome/common/extensions/api/experimental_systeminfo_storage.idl
@@ -0,0 +1,66 @@
+// 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.
+
+namespace experimental.systeminfo.storage {
+
+ enum StorageUnitType {
+ // Unknow storage type
+ unknown,
+ // Hard disk
+ harddisk,
+ // USB Mass storage
+ usb,
+ // SD card
+ mmc
+ };
+
+ dictionary StorageUnitInfo {
+ // The unique id
James Hawkins 2012/08/09 15:47:34 nit: Comments must end with a period, here and els
Hongbo Min 2012/08/12 03:31:58 Done.
+ DOMString id;
+ // The type of storage device. The value is one of the constants defined
+ // for this type.
+ StorageUnitType type;
+ // The total amount of the storage space, in bytes.
+ double capacity;
+ // The available amount of the storage space, in bytes.
+ double availableCapacity;
+ };
+
+ dictionary StorageInfo {
+ // The array of storage units connected to the system.
+ StorageUnitInfo[] units;
+ };
+
+ dictionary StorageUnitChangeInfo {
+ // The unique ID of storage unit on which the change is taken place.
+ DOMString id;
+ // The changed availableCapacity property
+ double availableCapacity;
+ };
+
+ callback StorageInfoCallback = void (StorageInfo info);
+ callback StorageUnitChangeCallback = void (StorageUnitChangeInfo unit);
+
+ interface Functions {
+ // Get the storage information in the system
+ static void get(StorageInfoCallback callback);
+ };
+
+ interface Events {
+ // Fired when the specified storage unit information is updated.
+ // |info| : The changed information for the specified storage unit
+ static void onChanged(StorageUnitChangeInfo info);
+
+ // Fired when a new storage unit is added to the system,
+ // i.e. a new USB disk is plugged in.
+ // |unit| : The information of the new storage unit
+ static void onAdded(StorageUnitInfo unit);
+
+ // Fired when a storage unit is removed from the system
+ // i.e. a USB disk is unplugged
+ // |id| : The unique ID of storage unit already removed
+ static void onRemoved(DOMString id);
+ };
+};
+

Powered by Google App Engine
This is Rietveld 408576698