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

Side by Side Diff: chrome/browser/extensions/api/system_storage/system_storage_api.h

Issue 389633002: Move system.* family of APIs to extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Inlined simple getters and removed redundant namespace decl Created 6 years, 3 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 2013 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_SYSTEM_STORAGE_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_SYSTEM_STORAGE_API_H_
7
8 #include "chrome/browser/extensions/api/system_storage/storage_info_provider.h"
9 #include "components/storage_monitor/storage_monitor.h"
10 #include "extensions/browser/extension_function.h"
11
12 namespace extensions {
13
14 // Implementation of the systeminfo.storage.get API. It is an asynchronous
15 // call relative to browser UI thread.
16 class SystemStorageGetInfoFunction : public AsyncExtensionFunction {
17 public:
18 DECLARE_EXTENSION_FUNCTION("system.storage.getInfo", SYSTEM_STORAGE_GETINFO);
19 SystemStorageGetInfoFunction();
20
21 private:
22 virtual ~SystemStorageGetInfoFunction();
23 virtual bool RunAsync() OVERRIDE;
24
25 void OnGetStorageInfoCompleted(bool success);
26 };
27
28 class SystemStorageEjectDeviceFunction
29 : public AsyncExtensionFunction {
30 public:
31 DECLARE_EXTENSION_FUNCTION("system.storage.ejectDevice",
32 SYSTEM_STORAGE_EJECTDEVICE);
33
34 protected:
35 virtual ~SystemStorageEjectDeviceFunction();
36
37 // AsyncExtensionFunction overrides.
38 virtual bool RunAsync() OVERRIDE;
39
40 private:
41 void OnStorageMonitorInit(const std::string& transient_device_id);
42
43 // Eject device request handler.
44 void HandleResponse(storage_monitor::StorageMonitor::EjectStatus status);
45 };
46
47 class SystemStorageGetAvailableCapacityFunction
48 : public AsyncExtensionFunction {
49 public:
50 DECLARE_EXTENSION_FUNCTION("system.storage.getAvailableCapacity",
51 SYSTEM_STORAGE_GETAVAILABLECAPACITY);
52 SystemStorageGetAvailableCapacityFunction();
53
54 private:
55 void OnStorageMonitorInit(const std::string& transient_id);
56 void OnQueryCompleted(const std::string& transient_id,
57 double available_capacity);
58 virtual ~SystemStorageGetAvailableCapacityFunction();
59 virtual bool RunAsync() OVERRIDE;
60 };
61
62 } // namespace extensions
63
64 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_SYSTEM_STORAGE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698