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

Side by Side Diff: chrome/common/extensions/api/experimental_system_info_storage.idl

Issue 18578008: [SystemInfo API] Move Storage API out of experimental namespace and rename to the "system" namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix PermissionTest unittest. Created 7 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 unified diff | Download patch
OLDNEW
(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.experimental.systemInfo.storage</code> API to query
6 // storage device information and be notified when it changes.
7 namespace experimental.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.
27 double capacity;
28 };
29
30 [inline_doc] enum EjectDeviceResultCode {
31 // The ejection command is successful -- the application can prompt the user
32 // to remove the device.
33 success,
34 // The device is in use by another application. The ejection did not
35 // succeed; the user should not remove the device until the other
36 // application is done with the device.
37 in_use,
38 // There is no such device known.
39 no_such_device,
40 // The ejection command failed.
41 failure
42 };
43
44 dictionary StorageFreeSpaceChangeInfo {
45 // The transient id of the storage unit already changed.
46 DOMString id;
47 // The new value of the available capacity.
48 double availableCapacity;
49 };
50
51 // A dictionary that describes the add particular storage device watch
52 // request results.
53 dictionary AddWatchResult {
54 DOMString id;
55 boolean success;
56 };
57
58 callback StorageInfoCallback = void (StorageUnitInfo[] info);
59
60 callback EjectDeviceCallback = void (EjectDeviceResultCode result);
61
62 callback AddWatchCallback = void (AddWatchResult info);
63
64 callback GetAllWatchCallback = void (DOMString[] storageIds);
65
66 interface Functions {
67 // Get the storage information from the system. The argument passed to the
68 // callback is an array of StorageUnitInfo objects.
69 static void get(StorageInfoCallback callback);
70
71 // Ejects a removable storage device.
72 // Note: We plan to move this function into a namespace that indicates it
73 // that modifies the state of the system rather than just gathering
74 // information.
75 static void ejectDevice(DOMString id, EjectDeviceCallback callback);
76
77 // Monitor a particular storage device available change capacity.
78 static void addWatch(DOMString id, AddWatchCallback callback);
79
80 // Remove the monitor of a particular device.
81 static void removeWatch(DOMString id);
82
83 // Get all the watched storage devices.
84 static void getAllWatch(GetAllWatchCallback callback);
85
86 // Remove all the storage devices monitors.
87 static void removeAllWatch();
88 };
89
90 interface Events {
91 // Fired when the storage device available capacity is changed.
92 // |info|: The changed information for the specified storage unit.
93 static void onAvailableCapacityChanged(StorageFreeSpaceChangeInfo info);
94
95 // Fired when a new removable storage is attached to the system.
96 static void onAttached(StorageUnitInfo info);
97
98 // Fired when a removable storage is detached from the system.
99 static void onDetached(DOMString id);
100 };
101
102 };
103
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698