[go: up one dir, main page]

blob: dd289e07ba20612d4eb6ac0165bb56ac8cb61dbf [file] [log] [blame]
Zelidrag Hornung3b12cdc2011-03-16 20:28:321// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
rspangler@google.comabb66d22009-10-10 00:23:492// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
David Moore363c95e2010-02-23 00:41:345#include <cstdio>
rspangler@google.comabb66d22009-10-10 00:23:496#include <dlfcn.h>
David Moore363c95e2010-02-23 00:41:347#include <string.h>
Chris Masonecc58f462010-08-20 23:53:008#include <vector>
9
Steven Bennetts11ac0492011-02-24 23:01:1510#include "base/basictypes.h"
Dominic Mazzonia0020012011-07-08 21:23:4011#include "base/values.h"
Daniel Erat7537f1e2010-12-07 22:00:1612#include "chromeos_brightness.h" // NOLINT
rspangler@google.comabb66d22009-10-10 00:23:4913#include "chromeos_cros_api.h" // NOLINT
Frank Swiderski06501a02010-05-27 00:35:4314#include "chromeos_cryptohome.h" // NOLINT
Toni Barzica4a45a32010-08-20 21:01:5715#include "chromeos_imageburn.h" //NOLINT
Kuan Tan9fb4a742011-01-27 22:03:1016#include "chromeos_libcros_service.h" // NOLINT
Chris Masone2d1aa252010-02-05 22:06:0517#include "chromeos_login.h" // NOLINT
dhg@google.com624040b2009-10-27 16:44:3518#include "chromeos_mount.h" // NOLINT
rspangler@google.comabb66d22009-10-10 00:23:4919#include "chromeos_network.h" // NOLINT
Steven Bennettsc78929b2011-02-14 18:15:4320#include "chromeos_network_deprecated.h" // NOLINT
rspangler@google.comabb66d22009-10-10 00:23:4921#include "chromeos_power.h" // NOLINT
Denis Glotovd44915a2011-02-14 17:59:1222#include "chromeos_resume.h" // NOLINT
Mitsuru Oshimaf3f68352010-05-10 17:08:3123#include "chromeos_screen_lock.h" // NOLINT
Chaitanya Gharpure8b422582010-04-21 23:54:2024#include "chromeos_speech_synthesis.h" // NOLINT
Andrew de los Reyes9fe15e82010-06-07 23:41:5425#include "chromeos_update_engine.h" // NOLINT
rspangler@google.comabb66d22009-10-10 00:23:4926
David Moore363c95e2010-02-23 00:41:3427namespace chromeos { // NOLINT //
rspangler@google.comabb66d22009-10-10 00:23:4928
Steven Bennetts11ac0492011-02-24 23:01:1529namespace {
30// If set, points to a function provided by Chrome to add a histogram.
31LibcrosTimeHistogramFunc addHistogram = NULL;
32// Pointer to libcros (from ::dlopen call).
33void* dll_handle = NULL;
34}
35
36class TimerInst {
37 public:
38 TimerInst(const char* name) {
39 if (addHistogram) {
40 name_ = std::string("Cros.") + name;
41 start_ = base::TimeTicks::Now();
42 }
43 }
44 ~TimerInst() {
45 if (addHistogram) {
46 base::TimeDelta delta = base::TimeTicks::Now() - start_;
47 addHistogram(name_.c_str(), delta);
48 }
49 }
50
51 private:
52 std::string name_;
53 base::TimeTicks start_;
54};
David Moore363c95e2010-02-23 00:41:3455
56// Declare Function. These macros are used to define the imported functions
57// from libcros. They will declare the proper type and define an exported
58// variable to be used to call the function.
59// |name| is the name of the function.
60// |ret| is the return type.
Yusuke Sato61ad7b72010-04-21 04:11:2961// |arg[1-5]| are the types are the arguments.
David Moore363c95e2010-02-23 00:41:3462// These are compile time declarations only.
63// INIT_FUNC(name) needs to be called at runtime.
Steven Bennetts11ac0492011-02-24 23:01:1564#define DECL_FUNC_0(name, ret) \
65 typedef ret (*name##Type)(); \
66 name##Type name = 0; \
67 ret WrapChromeOS##name() { \
68 static name##Type func = name##Type(::dlsym(dll_handle, "ChromeOS"#name)); \
69 TimerInst timer(#name); return func(); }
David Moore363c95e2010-02-23 00:41:3470
Steven Bennetts11ac0492011-02-24 23:01:1571#define DECL_FUNC_1(name, ret, arg1) \
72 typedef ret (*name##Type)(arg1); \
73 name##Type name = 0; \
74 ret WrapChromeOS##name(arg1 a1) { \
75 static name##Type func = name##Type(::dlsym(dll_handle, "ChromeOS"#name)); \
76 TimerInst timer(#name); return func(a1); }
David Moore363c95e2010-02-23 00:41:3477
Steven Bennetts11ac0492011-02-24 23:01:1578#define DECL_FUNC_2(name, ret, arg1, arg2) \
79 typedef ret (*name##Type)(arg1, arg2); \
80 name##Type name = 0; \
81 ret WrapChromeOS##name(arg1 a1, arg2 a2) { \
82 static name##Type func = name##Type(::dlsym(dll_handle, "ChromeOS"#name)); \
83 TimerInst timer(#name); return func(a1, a2); }
David Moore363c95e2010-02-23 00:41:3484
Steven Bennetts11ac0492011-02-24 23:01:1585#define DECL_FUNC_3(name, ret, arg1, arg2, arg3) \
86 typedef ret (*name##Type)(arg1, arg2, arg3); \
87 name##Type name = 0; \
88 ret WrapChromeOS##name(arg1 a1, arg2 a2, arg3 a3) { \
89 static name##Type func = name##Type(::dlsym(dll_handle, "ChromeOS"#name)); \
90 TimerInst timer(#name); return func(a1, a2, a3); }
David Moore363c95e2010-02-23 00:41:3491
Steven Bennetts11ac0492011-02-24 23:01:1592#define DECL_FUNC_4(name, ret, arg1, arg2, arg3, arg4) \
93 typedef ret (*name##Type)(arg1, arg2, arg3, arg4); \
94 name##Type name = 0; \
95 ret WrapChromeOS##name(arg1 a1, arg2 a2, arg3 a3, arg4 a4) { \
96 static name##Type func = name##Type(::dlsym(dll_handle, "ChromeOS"#name)); \
97 TimerInst timer(#name); return func(a1, a2, a3, a4); }
David Moore363c95e2010-02-23 00:41:3498
Steven Bennetts11ac0492011-02-24 23:01:1599#define DECL_FUNC_5(name, ret, arg1, arg2, arg3, arg4, arg5) \
100 typedef ret (*name##Type)(arg1, arg2, arg3, arg4, arg5); \
101 name##Type name = 0; \
102 extern "C" ret ChromeOS##name(arg1, arg2, arg3, arg4, arg5); \
103 ret WrapChromeOS##name( \
104 arg1 a1, arg2 a2, arg3 a3, arg4 a4, arg5 a5) { \
105 static name##Type func = name##Type(::dlsym(dll_handle, "ChromeOS"#name)); \
106 TimerInst timer(#name); return func(a1, a2, a3, a4, a5); }
Yusuke Sato61ad7b72010-04-21 04:11:29107
Steven Bennetts11ac0492011-02-24 23:01:15108#define DECL_FUNC_6(name, ret, arg1, arg2, arg3, arg4, arg5, arg6) \
109 typedef ret (*name##Type)(arg1, arg2, arg3, arg4, arg5, arg6); \
110 name##Type name = 0; \
111 extern "C" ret ChromeOS##name(arg1, arg2, arg3, arg4, arg5, arg6); \
112 ret WrapChromeOS##name( \
113 arg1 a1, arg2 a2, arg3 a3, arg4 a4, arg5 a5, arg6 a6) { \
114 static name##Type func = name##Type(::dlsym(dll_handle, "ChromeOS"#name)); \
115 TimerInst timer(#name); return func(a1, a2, a3, a4, a5, a6); }
Frank Swiderski692b1dd2010-09-27 22:46:46116
David Moore363c95e2010-02-23 00:41:34117// Version
118DECL_FUNC_1(CrosVersionCheck, bool, chromeos::CrosAPIVersion);
119
120// Power
121DECL_FUNC_2(MonitorPowerStatus, PowerStatusConnection, PowerMonitor, void*);
122DECL_FUNC_1(DisconnectPowerStatus, void, PowerStatusConnection);
123DECL_FUNC_1(RetrievePowerInformation, bool, PowerInformation*);
xiyuanaaba7862010-10-05 19:08:32124DECL_FUNC_1(EnableScreenLock, void, bool);
Satoru Takabayashi1b3a2ea2010-10-21 07:33:53125DECL_FUNC_0(RequestRestart, void);
Satoru Takabayashi971cbbd2010-10-20 05:54:14126DECL_FUNC_0(RequestShutdown, void);
Denis Glotovd44915a2011-02-14 17:59:12127DECL_FUNC_2(MonitorResume, ResumeConnection, ResumeMonitor, void*);
128DECL_FUNC_1(DisconnectResume, void, ResumeConnection);
David Moore363c95e2010-02-23 00:41:34129
David Moore363c95e2010-02-23 00:41:34130// Mount
Zelidrag Hornung3b12cdc2011-03-16 20:28:32131DECL_FUNC_3(MountRemovableDevice, void,
132 const char*, MountRequestCallback, void*);
133DECL_FUNC_3(UnmountRemovableDevice, void,
134 const char*, MountRequestCallback, void*);
135DECL_FUNC_3(GetDiskProperties, void,
136 const char*, GetDiskPropertiesCallback, void*);
137DECL_FUNC_2(RequestMountInfo, void,
138 RequestMountInfoCallback, void*);
139DECL_FUNC_2(MonitorMountEvents, MountEventConnection, MountEventMonitor, void*);
140DECL_FUNC_1(DisconnectMountEventMonitor, void, MountEventConnection);
141
142// TODO(zelidrag): Remove this chunk after libcros package rev up:
David Moore363c95e2010-02-23 00:41:34143DECL_FUNC_2(MonitorMountStatus, MountStatusConnection, MountMonitor, void*);
144DECL_FUNC_1(DisconnectMountStatus, void, MountStatusConnection);
145DECL_FUNC_0(RetrieveMountInformation, MountStatus*);
146DECL_FUNC_1(FreeMountStatus, void, MountStatus*);
David Garcia47d71f02010-04-02 21:07:19147DECL_FUNC_1(MountDevicePath, bool, const char*);
Toni Barzicfabdef82010-08-14 01:00:01148DECL_FUNC_1(UnmountDevicePath, bool, const char*);
Achuith Bhandarkara186acd2011-01-13 22:50:11149DECL_FUNC_1(IsBootDevicePath, bool, const char*);
David Moore363c95e2010-02-23 00:41:34150
151// Networking
Charlie Leea167a2c2010-03-18 16:34:18152DECL_FUNC_0(GetSystemInfo, SystemInfo*);
Charlie Leec1e74f92010-03-15 23:35:28153DECL_FUNC_1(RequestScan, void, ConnectionType);
Charlie Lee210cd5a2010-03-13 00:23:01154DECL_FUNC_2(GetWifiService, ServiceInfo*, const char*, ConnectionSecurity);
Charlie Leea6488bb2010-08-17 16:36:18155DECL_FUNC_2(ActivateCellularModem, bool, const char*, const char*);
Nathan Williamsd3e90bd2010-08-02 18:51:06156DECL_FUNC_5(ConfigureWifiService, bool, const char*, ConnectionSecurity,
157 const char*, const char*, const char*);
Nathan Williamsad28b982011-03-03 19:08:39158DECL_FUNC_3(SetNetworkServiceProperty, void, const char*, const char*,
Dominic Mazzonia0020012011-07-08 21:23:40159 const Value *);
Nathan Williams836f1492011-03-24 23:22:38160DECL_FUNC_2(ClearNetworkServiceProperty, void, const char*, const char*);
Nathan Williamsc53083d2011-04-21 22:08:26161DECL_FUNC_3(SetNetworkDeviceProperty, void, const char*, const char*,
Dominic Mazzonia0020012011-07-08 21:23:40162 const Value *);
Nathan Williamsc53083d2011-04-21 22:08:26163DECL_FUNC_2(ClearNetworkDeviceProperty, void, const char*, const char*);
Charlie Lee858ed672011-05-26 20:29:57164DECL_FUNC_3(SetNetworkIPConfigProperty, void, const char*, const char*,
Dominic Mazzonia0020012011-07-08 21:23:40165 const Value *);
Charlie Lee858ed672011-05-26 20:29:57166DECL_FUNC_2(ClearNetworkIPConfigProperty, void, const char*, const char*);
Steven Bennetts284f9cf2011-05-11 23:20:16167DECL_FUNC_2(DeleteServiceFromProfile, void, const char*, const char*);
Charlie Leeb3dd8be2010-04-30 22:10:22168DECL_FUNC_1(DisconnectFromNetwork, bool, const char*);
Charlie Lee3254aa92010-04-19 21:12:06169DECL_FUNC_1(DeleteRememberedService, bool, const char*);
Charlie Leea167a2c2010-03-18 16:34:18170DECL_FUNC_1(FreeSystemInfo, void, SystemInfo*);
Charlie Lee210cd5a2010-03-13 00:23:01171DECL_FUNC_1(FreeServiceInfo, void, ServiceInfo*);
Eric Shienbrood882feba2010-11-19 04:27:00172// MonitorNetwork is deprecated: use MonitorNetworkManager
173DECL_FUNC_2(MonitorNetwork,
174 MonitorNetworkConnection, MonitorNetworkCallback, void*);
175// DisconnectMonitorNetwork is deprecated: use DisconnectPropertyChangeMonitor
176DECL_FUNC_1(DisconnectMonitorNetwork, void, MonitorNetworkConnection);
Eric Shienbrooda4e3a772010-09-17 19:54:40177DECL_FUNC_2(MonitorNetworkManager, PropertyChangeMonitor,
178 MonitorPropertyCallback, void*);
179DECL_FUNC_1(DisconnectPropertyChangeMonitor, void, PropertyChangeMonitor);
180DECL_FUNC_3(MonitorNetworkService, PropertyChangeMonitor,
181 MonitorPropertyCallback, const char*, void*);
Eric Shienbrood853fc8a2011-04-07 22:39:14182DECL_FUNC_3(MonitorNetworkDevice, PropertyChangeMonitor,
183 MonitorPropertyCallback, const char*, void*);
Steven Bennetts81677aa2010-09-27 19:49:57184DECL_FUNC_2(MonitorCellularDataPlan, DataPlanUpdateMonitor,
185 MonitorDataPlanCallback, void*);
186DECL_FUNC_1(DisconnectDataPlanUpdateMonitor, void, DataPlanUpdateMonitor);
Zelidrag Hornungd4465702010-11-04 18:45:37187DECL_FUNC_1(RetrieveCellularDataPlans, CellularDataPlanList*, const char*);
Steven Bennetts81677aa2010-09-27 19:49:57188DECL_FUNC_1(RequestCellularDataPlanUpdate, void, const char*);
Zelidrag Hornungd4465702010-11-04 18:45:37189DECL_FUNC_1(FreeCellularDataPlanList, void, CellularDataPlanList*);
Nathan Williamsf25299c2011-03-25 21:17:25190DECL_FUNC_3(MonitorSMS, SMSMonitor, const char*, MonitorSMSCallback, void*);
191DECL_FUNC_1(DisconnectSMSMonitor, void, SMSMonitor);
Nathan Williamsad28b982011-03-03 19:08:39192DECL_FUNC_3(RequestNetworkServiceConnect, void, const char*,
193 NetworkActionCallback, void *);
Steven Bennettsc78929b2011-02-14 18:15:43194DECL_FUNC_2(RequestNetworkManagerInfo, void,
195 NetworkPropertiesCallback, void*);
196DECL_FUNC_3(RequestNetworkServiceInfo, void, const char*,
197 NetworkPropertiesCallback, void*);
198DECL_FUNC_3(RequestNetworkDeviceInfo, void, const char*,
199 NetworkPropertiesCallback, void*);
200DECL_FUNC_3(RequestNetworkProfile, void, const char*,
201 NetworkPropertiesCallback, void*);
202DECL_FUNC_4(RequestNetworkProfileEntry, void, const char*, const char*,
203 NetworkPropertiesCallback, void*);
204DECL_FUNC_4(RequestWifiServicePath, void, const char*, ConnectionSecurity,
205 NetworkPropertiesCallback, void*);
Steven Bennettsfa0877f2011-03-03 23:21:19206DECL_FUNC_4(RequestHiddenWifiNetwork, void, const char*, const char*,
207 NetworkPropertiesCallback, void*);
Steven Bennetts88971812011-03-25 17:21:40208DECL_FUNC_5(RequestVirtualNetwork, void, const char*, const char*, const char*,
209 NetworkPropertiesCallback, void*);
Steven Bennettsfa0877f2011-03-03 23:21:19210DECL_FUNC_1(RequestNetworkScan, void, const char*);
211DECL_FUNC_2(RequestNetworkDeviceEnable, void, const char*, bool);
Eric Shienbrood853fc8a2011-04-07 22:39:14212DECL_FUNC_5(RequestRequirePin, void, const char*, const char*, bool,
213 NetworkActionCallback, void*);
214DECL_FUNC_4(RequestEnterPin, void, const char*, const char*,
215 NetworkActionCallback, void*);
216DECL_FUNC_5(RequestUnblockPin, void, const char*, const char*, const char*,
217 NetworkActionCallback, void*);
218DECL_FUNC_5(RequestChangePin, void, const char*, const char*, const char*,
219 NetworkActionCallback, void*);
Dmitry Polukhin4d7c3bf2011-04-19 09:23:36220DECL_FUNC_1(ProposeScan, void, const char*);
221DECL_FUNC_4(RequestCellularRegister, void, const char*, const char*,
222 NetworkActionCallback, void*);
David Moore363c95e2010-02-23 00:41:34223DECL_FUNC_2(EnableNetworkDevice, bool, ConnectionType, bool);
224DECL_FUNC_1(SetOfflineMode, bool, bool);
Charlie Lee3254aa92010-04-19 21:12:06225DECL_FUNC_2(SetAutoConnect, bool, const char*, bool);
Charlie Leeb3dd8be2010-04-30 22:10:22226DECL_FUNC_2(SetPassphrase, bool, const char*, const char*);
Nathan Williamsbfe0d722010-05-10 22:17:59227DECL_FUNC_2(SetIdentity, bool, const char*, const char*);
David Moore363c95e2010-02-23 00:41:34228DECL_FUNC_1(ListIPConfigs, IPConfigStatus*, const char*);
229DECL_FUNC_2(AddIPConfig, bool, const char*, IPConfigType);
230DECL_FUNC_1(SaveIPConfig, bool, IPConfig*);
231DECL_FUNC_1(RemoveIPConfig, bool, IPConfig*);
232DECL_FUNC_1(FreeIPConfig, void, IPConfig*);
233DECL_FUNC_1(FreeIPConfigStatus, void, IPConfigStatus*);
Charlie Leecc1c63d2010-07-14 18:07:01234DECL_FUNC_0(GetDeviceNetworkList, DeviceNetworkList*);
235DECL_FUNC_1(FreeDeviceNetworkList, void, DeviceNetworkList*);
David Moore363c95e2010-02-23 00:41:34236
David Moore363c95e2010-02-23 00:41:34237// Login
David Moore363c95e2010-02-23 00:41:34238DECL_FUNC_0(EmitLoginPromptReady, bool);
Chris Masone37e26dd2010-08-26 16:11:41239DECL_FUNC_2(RestartJob, bool, int, const char*);
Ken Mixter82f15fd2010-11-23 21:57:32240DECL_FUNC_0(RestartEntd, bool);
Chris Masonec18251d2011-03-23 00:52:12241DECL_FUNC_2(RetrievePolicy, void, RetrievePolicyCallback, void*);
David Moore363c95e2010-02-23 00:41:34242DECL_FUNC_2(StartSession, bool, const char*, const char*);
243DECL_FUNC_1(StopSession, bool, const char*);
Chris Masone4f6c04e2011-04-06 22:32:36244DECL_FUNC_4(StorePolicy,
245 void,
246 const char*,
247 const unsigned int,
248 StorePolicyCallback,
249 void*);
Chris Masonecc58f462010-08-20 23:53:00250DECL_FUNC_2(MonitorSession, SessionConnection, SessionMonitor, void*);
251DECL_FUNC_1(DisconnectSession, void, SessionConnection);
rspangler@google.comabb66d22009-10-10 00:23:49252
Nathan Williamsbfe0d722010-05-10 22:17:59253// Screen Lock
Mitsuru Oshimaf3f68352010-05-10 17:08:31254DECL_FUNC_2(MonitorScreenLock,
255 ScreenLockConnection, ScreenLockMonitor, void*);
256DECL_FUNC_1(DisconnectScreenLock, void, ScreenLockConnection);
257DECL_FUNC_0(NotifyScreenLockCompleted, void);
258DECL_FUNC_0(NotifyScreenLockRequested, void);
Mitsuru Oshimaf4d424d2010-05-14 08:46:22259DECL_FUNC_0(NotifyScreenUnlockRequested, void);
Mitsuru Oshima6b6dc2a2010-05-19 04:31:26260DECL_FUNC_0(NotifyScreenUnlockCompleted, void);
Mitsuru Oshimaf3f68352010-05-10 17:08:31261
Chris Masonee9d48f22010-03-08 19:18:58262// Cryptohome
263DECL_FUNC_2(CryptohomeCheckKey, bool, const char*, const char*);
Frank Swiderskic317de62010-08-31 18:08:58264DECL_FUNC_2(CryptohomeAsyncCheckKey, int, const char*, const char*);
Frank Swiderski06501a02010-05-27 00:35:43265DECL_FUNC_3(CryptohomeMigrateKey, bool, const char*, const char*, const char*);
Frank Swiderskic317de62010-08-31 18:08:58266DECL_FUNC_3(CryptohomeAsyncMigrateKey,
267 int,
268 const char*,
269 const char*,
270 const char*);
Frank Swiderski06501a02010-05-27 00:35:43271DECL_FUNC_1(CryptohomeRemove, bool, const char*);
Frank Swiderskice164042010-09-10 21:54:37272DECL_FUNC_1(CryptohomeAsyncRemove, int, const char*);
Frank Swiderski06501a02010-05-27 00:35:43273DECL_FUNC_0(CryptohomeGetSystemSalt, CryptohomeBlob);
Frank Swiderski880db712011-01-18 21:46:33274DECL_FUNC_2(CryptohomeGetSystemSaltSafe, bool, char**, int*);
Chris Masonee9d48f22010-03-08 19:18:58275DECL_FUNC_0(CryptohomeIsMounted, bool);
Frank Swiderski13dd1042010-06-11 19:36:00276DECL_FUNC_3(CryptohomeMountAllowFail, bool, const char*, const char*, int*);
Frank Swiderski692b1dd2010-09-27 22:46:46277DECL_FUNC_6(CryptohomeMount, bool, const char*, const char*, bool, bool,
278 const std::vector<std::string>&, int*);
Frank Swiderski880db712011-01-18 21:46:33279DECL_FUNC_6(CryptohomeMountSafe, bool, const char*, const char*, bool, bool,
280 const char**, int*);
Frank Swiderski692b1dd2010-09-27 22:46:46281DECL_FUNC_5(CryptohomeAsyncMount, int, const char*, const char*, bool, bool,
282 const std::vector<std::string>&);
Frank Swiderski880db712011-01-18 21:46:33283DECL_FUNC_5(CryptohomeAsyncMountSafe, int, const char*, const char*, bool, bool,
284 const char**);
Frank Swiderski13dd1042010-06-11 19:36:00285DECL_FUNC_1(CryptohomeMountGuest, bool, int*);
Frank Swiderskic317de62010-08-31 18:08:58286DECL_FUNC_0(CryptohomeAsyncMountGuest, int);
Chris Masonee9d48f22010-03-08 19:18:58287DECL_FUNC_0(CryptohomeUnmount, bool);
Frank Swiderski692b1dd2010-09-27 22:46:46288DECL_FUNC_0(CryptohomeRemoveTrackedSubdirectories, bool);
289DECL_FUNC_0(CryptohomeAsyncRemoveTrackedSubdirectories, int);
Denis Glotova7f3eec2011-03-04 15:11:38290DECL_FUNC_0(CryptohomeDoAutomaticFreeDiskSpaceControl, bool);
291DECL_FUNC_0(CryptohomeAsyncDoAutomaticFreeDiskSpaceControl, int);
Denis Glotov4f3db482011-04-20 16:35:57292DECL_FUNC_1(CryptohomeAsyncSetOwnerUser, int, const char*);
Frank Swiderski6e238ab2010-08-06 20:37:06293DECL_FUNC_0(CryptohomeTpmIsReady, bool);
294DECL_FUNC_0(CryptohomeTpmIsEnabled, bool);
Frank Swiderskidf0f40d2010-09-01 22:43:08295DECL_FUNC_0(CryptohomeTpmIsOwned, bool);
296DECL_FUNC_0(CryptohomeTpmIsBeingOwned, bool);
Frank Swiderski6e238ab2010-08-06 20:37:06297DECL_FUNC_1(CryptohomeTpmGetPassword, bool, std::string*);
Frank Swiderski880db712011-01-18 21:46:33298DECL_FUNC_1(CryptohomeTpmGetPasswordSafe, bool, char**);
Frank Swiderski39281852010-10-04 22:16:28299DECL_FUNC_0(CryptohomeTpmCanAttemptOwnership, void);
300DECL_FUNC_0(CryptohomeTpmClearStoredPassword, void);
Ken Mixter77ef50e2011-04-12 20:36:41301DECL_FUNC_0(CryptohomePkcs11IsTpmTokenReady, bool);
302DECL_FUNC_2(CryptohomePkcs11GetTpmTokenInfo, void, std::string*, std::string*);
Frank Swiderskidf0f40d2010-09-01 22:43:08303DECL_FUNC_1(CryptohomeGetStatusString, bool, std::string*);
Frank Swiderski880db712011-01-18 21:46:33304DECL_FUNC_1(CryptohomeGetStatusStringSafe, bool, char**);
Julian Pastarmov1081ddb2011-04-15 12:19:38305DECL_FUNC_2(CryptohomeInstallAttributesGet, bool, const char*, char**);
306DECL_FUNC_2(CryptohomeInstallAttributesSet, bool, const char*, const char*);
307DECL_FUNC_0(CryptohomeInstallAttributesCount, int);
308DECL_FUNC_0(CryptohomeInstallAttributesFinalize, bool);
309DECL_FUNC_0(CryptohomeInstallAttributesIsReady, bool);
310DECL_FUNC_0(CryptohomeInstallAttributesIsSecure, bool);
311DECL_FUNC_0(CryptohomeInstallAttributesIsInvalid, bool);
312DECL_FUNC_0(CryptohomeInstallAttributesIsFirstInstall, bool);
Frank Swiderski880db712011-01-18 21:46:33313DECL_FUNC_1(CryptohomeFreeString, void, char*);
314DECL_FUNC_1(CryptohomeFreeBlob, void, char*);
Frank Swiderskic317de62010-08-31 18:08:58315DECL_FUNC_2(CryptohomeMonitorSession, void*, CryptohomeSignalCallback, void*);
316DECL_FUNC_1(CryptohomeDisconnectSession, void, void*);
Chris Masonee9d48f22010-03-08 19:18:58317
Toni Barzica4a45a32010-08-20 21:01:57318// Imageburn
319DECL_FUNC_2(MonitorBurnStatus, BurnStatusConnection, BurnMonitor, void*);
320DECL_FUNC_1(DisconnectBurnStatus, void, BurnStatusConnection);
321DECL_FUNC_3(StartBurn, void, const char*, const char*, BurnStatusConnection);
tbarzic160d7952011-05-14 02:15:40322DECL_FUNC_4(RequestBurn, void, const char*, const char*, BurnMonitor, void*);
Toni Barzica4a45a32010-08-20 21:01:57323
Andrew de los Reyes9fe15e82010-06-07 23:41:54324// Update Engine (replacing Update library)
325DECL_FUNC_2(MonitorUpdateStatus, UpdateStatusConnection, UpdateMonitor, void*);
326DECL_FUNC_1(DisconnectUpdateProgress, void, UpdateStatusConnection);
327DECL_FUNC_1(RetrieveUpdateProgress, bool, UpdateProgress*);
328DECL_FUNC_0(InitiateUpdateCheck, bool);
Darin Petkov69c5c262010-07-27 18:05:55329DECL_FUNC_0(RebootIfUpdated, bool);
Satoru Takabayashi9d2a2872010-10-27 04:49:08330DECL_FUNC_1(SetTrack, bool, const std::string&);
331DECL_FUNC_0(GetTrack, std::string);
James Cook8cab7202011-05-09 17:42:46332DECL_FUNC_2(RequestUpdateStatus, void, UpdateMonitor, void*);
Steven Bennetts82fea482011-03-16 16:57:15333DECL_FUNC_2(RequestUpdateCheck, void, UpdateCallback, void*);
334DECL_FUNC_1(SetUpdateTrack, void, const std::string&);
335DECL_FUNC_2(RequestUpdateTrack, void, UpdateTrackCallback, void*);
Andrew de los Reyes9fe15e82010-06-07 23:41:54336
Steven Bennetts82fea482011-03-16 16:57:15337// Speech Synthesis
Chaitanya Gharpure8b422582010-04-21 23:54:20338DECL_FUNC_1(Speak, bool, const char*);
339DECL_FUNC_1(SetSpeakProperties, bool, const char*);
340DECL_FUNC_0(StopSpeaking, bool);
341DECL_FUNC_0(IsSpeaking, bool);
Chaitanya Gharpure8d763fc2010-06-08 17:38:31342DECL_FUNC_1(InitTts, void, InitStatusCallback);
Chaitanya Gharpure8b422582010-04-21 23:54:20343
Daniel Erat7537f1e2010-12-07 22:00:16344// Brightness
Chris Wolfec8b0c122011-05-02 20:35:04345DECL_FUNC_1(DecreaseScreenBrightness, void, bool);
346DECL_FUNC_0(IncreaseScreenBrightness, void);
Daniel Eratccea53b2011-03-11 21:39:31347DECL_FUNC_2(MonitorBrightnessV2,
348 BrightnessConnection,
349 BrightnessMonitorFunctionV2,
350 void*);
Daniel Erat7537f1e2010-12-07 22:00:16351DECL_FUNC_2(MonitorBrightness,
352 BrightnessConnection,
353 BrightnessMonitorFunction,
354 void*);
355DECL_FUNC_1(DisconnectBrightness, void, BrightnessConnection);
356
Kuan Tan9fb4a742011-01-27 22:03:10357// LibCros Service
358DECL_FUNC_0(StartLibCrosService, LibCrosServiceConnection);
359DECL_FUNC_1(StopLibCrosService, void, LibCrosServiceConnection);
360DECL_FUNC_3(SetNetworkProxyResolver, void,
361 NetworkProxyResolver, void*, LibCrosServiceConnection);
362DECL_FUNC_4(NotifyNetworkProxyResolved, bool, const char*, const char*,
363 const char*, LibCrosServiceConnection);
Rahul Chaturvedie295bfb2010-05-12 23:08:51364
rspangler@google.comabb66d22009-10-10 00:23:49365char const * const kCrosDefaultPath = "/opt/google/chrome/chromeos/libcros.so";
366
David Moore363c95e2010-02-23 00:41:34367// Initializes the variable by looking up the function by |name|.
368// This macro uses the variable 'handle' and 'error_string'.
369#define INIT_FUNC(name) \
Steven Bennetts11ac0492011-02-24 23:01:15370 name = WrapChromeOS##name; \
371 if (!::dlsym(dll_handle, "ChromeOS"#name)) { \
David Moore363c95e2010-02-23 00:41:34372 error_string += "Couldn't load: "#name","; \
373 }
rspangler@google.comabb66d22009-10-10 00:23:49374
David Moore363c95e2010-02-23 00:41:34375bool LoadLibcros(const char* path_to_libcros, std::string& error_string) {
Steven Bennetts11ac0492011-02-24 23:01:15376 error_string.clear();
David Moore363c95e2010-02-23 00:41:34377
378 if (!path_to_libcros) {
379 error_string = "path_to_libcros can't be NULL";
rspangler@google.comabb66d22009-10-10 00:23:49380 return false;
dhg@google.com624040b2009-10-27 16:44:35381 }
chocobo@google.com30c54372009-10-21 19:47:06382
Steven Bennetts11ac0492011-02-24 23:01:15383 dll_handle = ::dlopen(path_to_libcros, RTLD_NOW);
384 if (dll_handle == NULL) {
David Moore363c95e2010-02-23 00:41:34385 error_string = "Couldn't load libcros from: ";
386 error_string += path_to_libcros;
387 error_string += " error: ";
388 error_string += dlerror();
rspangler@google.comabb66d22009-10-10 00:23:49389 return false;
David Moore363c95e2010-02-23 00:41:34390 }
rspangler@google.comabb66d22009-10-10 00:23:49391
David Moore363c95e2010-02-23 00:41:34392 INIT_FUNC(CrosVersionCheck);
393 if (!CrosVersionCheck) {
394 // error_string will already be set.
rspangler@google.comabb66d22009-10-10 00:23:49395 return false;
David Moore363c95e2010-02-23 00:41:34396 }
rspangler@google.comabb66d22009-10-10 00:23:49397
David Moore363c95e2010-02-23 00:41:34398 if (!CrosVersionCheck(chromeos::kCrosAPIVersion)) {
399 const int buf_size = sizeof(int)*8+1;
400 char buf[buf_size];
401 typedef int (*VersionFuncType)();
rspangler@google.comabb66d22009-10-10 00:23:49402
David Moore363c95e2010-02-23 00:41:34403 // These weren't exported from older copies of the library. It's not an
404 // error so we don't use INIT_FUNC()
405 VersionFuncType GetMinCrosVersion =
Steven Bennetts11ac0492011-02-24 23:01:15406 VersionFuncType(::dlsym(dll_handle, "ChromeOSGetMinCrosVersion"));
David Moore363c95e2010-02-23 00:41:34407 VersionFuncType GetCrosVersion =
Steven Bennetts11ac0492011-02-24 23:01:15408 VersionFuncType(::dlsym(dll_handle, "ChromeOSGetCrosVersion"));
rspangler@google.comabb66d22009-10-10 00:23:49409
David Moore363c95e2010-02-23 00:41:34410 error_string = "Incompatible libcros version. Client: ";
411 snprintf(buf, buf_size, "%d", chromeos::kCrosAPIVersion);
412 error_string += buf;
413 if (GetMinCrosVersion && GetCrosVersion) {
414 snprintf(buf, buf_size, "%d", GetMinCrosVersion());
415 error_string += " Min: ";
416 error_string += buf;
417 snprintf(buf, buf_size, "%d", GetCrosVersion());
418 error_string += " Max: ";
419 error_string += buf;
420 }
421 return false;
422 }
rspangler@google.comabb66d22009-10-10 00:23:49423
David Moore363c95e2010-02-23 00:41:34424 // Power
425 INIT_FUNC(MonitorPowerStatus);
426 INIT_FUNC(DisconnectPowerStatus);
427 INIT_FUNC(RetrievePowerInformation);
Yusuke Satofe3e2652010-10-22 01:25:11428 INIT_FUNC(EnableScreenLock);
429 INIT_FUNC(RequestRestart);
430 INIT_FUNC(RequestShutdown);
Denis Glotovd44915a2011-02-14 17:59:12431 INIT_FUNC(MonitorResume);
432 INIT_FUNC(DisconnectResume);
Yusuke Satod78e7be2009-12-15 01:54:58433
David Moore363c95e2010-02-23 00:41:34434 // Mount
Zelidrag Hornung3b12cdc2011-03-16 20:28:32435 INIT_FUNC(MountRemovableDevice);
436 INIT_FUNC(UnmountRemovableDevice);
437 INIT_FUNC(GetDiskProperties);
438 INIT_FUNC(RequestMountInfo);
439 INIT_FUNC(MonitorMountEvents);
440 INIT_FUNC(DisconnectMountEventMonitor);
441 // TODO(zelidrag): Remove these once libcro revs up.
David Moore363c95e2010-02-23 00:41:34442 INIT_FUNC(MonitorMountStatus);
443 INIT_FUNC(DisconnectMountStatus);
444 INIT_FUNC(RetrieveMountInformation);
445 INIT_FUNC(FreeMountStatus);
David Garcia47d71f02010-04-02 21:07:19446 INIT_FUNC(MountDevicePath);
Toni Barzicfabdef82010-08-14 01:00:01447 INIT_FUNC(UnmountDevicePath);
Achuith Bhandarkara186acd2011-01-13 22:50:11448 INIT_FUNC(IsBootDevicePath);
dhg@google.com624040b2009-10-27 16:44:35449
David Moore363c95e2010-02-23 00:41:34450 // Networking
Charlie Leea167a2c2010-03-18 16:34:18451 INIT_FUNC(GetSystemInfo);
Charlie Leec1e74f92010-03-15 23:35:28452 INIT_FUNC(RequestScan);
Charlie Lee210cd5a2010-03-13 00:23:01453 INIT_FUNC(GetWifiService);
Charlie Leea6488bb2010-08-17 16:36:18454 INIT_FUNC(ActivateCellularModem);
Nathan Williamsd3e90bd2010-08-02 18:51:06455 INIT_FUNC(ConfigureWifiService);
Nathan Williamsad28b982011-03-03 19:08:39456 INIT_FUNC(SetNetworkServiceProperty);
Nathan Williams836f1492011-03-24 23:22:38457 INIT_FUNC(ClearNetworkServiceProperty);
Nathan Williamsc53083d2011-04-21 22:08:26458 INIT_FUNC(SetNetworkDeviceProperty);
459 INIT_FUNC(ClearNetworkDeviceProperty);
Charlie Lee858ed672011-05-26 20:29:57460 INIT_FUNC(SetNetworkIPConfigProperty);
461 INIT_FUNC(ClearNetworkIPConfigProperty);
Steven Bennetts284f9cf2011-05-11 23:20:16462 INIT_FUNC(DeleteServiceFromProfile);
Charlie Leeb3dd8be2010-04-30 22:10:22463 INIT_FUNC(DisconnectFromNetwork);
Charlie Lee3254aa92010-04-19 21:12:06464 INIT_FUNC(DeleteRememberedService);
Charlie Leea167a2c2010-03-18 16:34:18465 INIT_FUNC(FreeSystemInfo);
Charlie Lee210cd5a2010-03-13 00:23:01466 INIT_FUNC(FreeServiceInfo);
Eric Shienbrood882feba2010-11-19 04:27:00467 // MonitorNetwork is deprecated: use MonitorNetworkManager
468 INIT_FUNC(MonitorNetwork);
469 // DisconnectMonitorNetwork is deprecated:
470 // use DisconnectPropertyChangeMonitor
471 INIT_FUNC(DisconnectMonitorNetwork);
Eric Shienbrooda4e3a772010-09-17 19:54:40472 INIT_FUNC(MonitorNetworkManager);
473 INIT_FUNC(DisconnectPropertyChangeMonitor);
474 INIT_FUNC(MonitorNetworkService);
Eric Shienbrood853fc8a2011-04-07 22:39:14475 INIT_FUNC(MonitorNetworkDevice);
David Moore363c95e2010-02-23 00:41:34476 INIT_FUNC(EnableNetworkDevice);
477 INIT_FUNC(SetOfflineMode);
Charlie Lee3254aa92010-04-19 21:12:06478 INIT_FUNC(SetAutoConnect);
Charlie Leeb3dd8be2010-04-30 22:10:22479 INIT_FUNC(SetPassphrase);
Nathan Williamsbfe0d722010-05-10 22:17:59480 INIT_FUNC(SetIdentity);
David Moore363c95e2010-02-23 00:41:34481 INIT_FUNC(ListIPConfigs);
482 INIT_FUNC(AddIPConfig);
483 INIT_FUNC(SaveIPConfig);
484 INIT_FUNC(RemoveIPConfig);
485 INIT_FUNC(FreeIPConfig);
486 INIT_FUNC(FreeIPConfigStatus);
Charlie Leecc1c63d2010-07-14 18:07:01487 INIT_FUNC(GetDeviceNetworkList);
488 INIT_FUNC(FreeDeviceNetworkList);
Steven Bennetts81677aa2010-09-27 19:49:57489 INIT_FUNC(MonitorCellularDataPlan);
490 INIT_FUNC(DisconnectDataPlanUpdateMonitor);
491 INIT_FUNC(RetrieveCellularDataPlans);
492 INIT_FUNC(RequestCellularDataPlanUpdate);
Zelidrag Hornungd4465702010-11-04 18:45:37493 INIT_FUNC(FreeCellularDataPlanList);
Nathan Williamsf25299c2011-03-25 21:17:25494 INIT_FUNC(MonitorSMS);
495 INIT_FUNC(DisconnectSMSMonitor);
Nathan Williamsad28b982011-03-03 19:08:39496 INIT_FUNC(RequestNetworkServiceConnect);
Steven Bennettsc78929b2011-02-14 18:15:43497 INIT_FUNC(RequestNetworkManagerInfo);
498 INIT_FUNC(RequestNetworkServiceInfo);
499 INIT_FUNC(RequestNetworkDeviceInfo);
500 INIT_FUNC(RequestNetworkProfile);
501 INIT_FUNC(RequestNetworkProfileEntry);
502 INIT_FUNC(RequestWifiServicePath);
Steven Bennettsfa0877f2011-03-03 23:21:19503 INIT_FUNC(RequestHiddenWifiNetwork);
Steven Bennetts88971812011-03-25 17:21:40504 INIT_FUNC(RequestVirtualNetwork);
Steven Bennettsfa0877f2011-03-03 23:21:19505 INIT_FUNC(RequestNetworkScan);
506 INIT_FUNC(RequestNetworkDeviceEnable);
Eric Shienbrood853fc8a2011-04-07 22:39:14507 INIT_FUNC(RequestRequirePin);
508 INIT_FUNC(RequestEnterPin);
509 INIT_FUNC(RequestUnblockPin);
510 INIT_FUNC(RequestChangePin);
Dmitry Polukhin4d7c3bf2011-04-19 09:23:36511 INIT_FUNC(ProposeScan);
512 INIT_FUNC(RequestCellularRegister);
dhg@google.com624040b2009-10-27 16:44:35513
David Moore363c95e2010-02-23 00:41:34514 // Login
David Moore363c95e2010-02-23 00:41:34515 INIT_FUNC(EmitLoginPromptReady);
Chris Masone37e26dd2010-08-26 16:11:41516 INIT_FUNC(RestartJob);
Ken Mixter82f15fd2010-11-23 21:57:32517 INIT_FUNC(RestartEntd);
Chris Masonec18251d2011-03-23 00:52:12518 INIT_FUNC(RetrievePolicy);
David Moore363c95e2010-02-23 00:41:34519 INIT_FUNC(StartSession);
520 INIT_FUNC(StopSession);
Chris Masonec18251d2011-03-23 00:52:12521 INIT_FUNC(StorePolicy);
Chris Masonecc58f462010-08-20 23:53:00522 INIT_FUNC(MonitorSession);
523 INIT_FUNC(DisconnectSession);
dhg@google.com624040b2009-10-27 16:44:35524
Mitsuru Oshimaf3f68352010-05-10 17:08:31525 // Screen Lock
526 INIT_FUNC(MonitorScreenLock);
527 INIT_FUNC(DisconnectScreenLock);
528 INIT_FUNC(NotifyScreenLockCompleted);
529 INIT_FUNC(NotifyScreenLockRequested);
Mitsuru Oshimaf4d424d2010-05-14 08:46:22530 INIT_FUNC(NotifyScreenUnlockRequested);
Mitsuru Oshima6b6dc2a2010-05-19 04:31:26531 INIT_FUNC(NotifyScreenUnlockCompleted);
Mitsuru Oshimaf3f68352010-05-10 17:08:31532
Chris Masonee9d48f22010-03-08 19:18:58533 // Cryptohome
534 INIT_FUNC(CryptohomeCheckKey);
Frank Swiderskic317de62010-08-31 18:08:58535 INIT_FUNC(CryptohomeAsyncCheckKey);
Frank Swiderski06501a02010-05-27 00:35:43536 INIT_FUNC(CryptohomeMigrateKey);
Frank Swiderskic317de62010-08-31 18:08:58537 INIT_FUNC(CryptohomeAsyncMigrateKey);
Frank Swiderski06501a02010-05-27 00:35:43538 INIT_FUNC(CryptohomeRemove);
Frank Swiderskice164042010-09-10 21:54:37539 INIT_FUNC(CryptohomeAsyncRemove);
Frank Swiderski06501a02010-05-27 00:35:43540 INIT_FUNC(CryptohomeGetSystemSalt);
Frank Swiderski880db712011-01-18 21:46:33541 INIT_FUNC(CryptohomeGetSystemSaltSafe);
Chris Masonee9d48f22010-03-08 19:18:58542 INIT_FUNC(CryptohomeIsMounted);
Frank Swiderski13dd1042010-06-11 19:36:00543 INIT_FUNC(CryptohomeMountAllowFail);
Chris Masonee9d48f22010-03-08 19:18:58544 INIT_FUNC(CryptohomeMount);
Frank Swiderski880db712011-01-18 21:46:33545 INIT_FUNC(CryptohomeMountSafe);
Frank Swiderskic317de62010-08-31 18:08:58546 INIT_FUNC(CryptohomeAsyncMount);
Frank Swiderski880db712011-01-18 21:46:33547 INIT_FUNC(CryptohomeAsyncMountSafe);
Frank Swiderski13dd1042010-06-11 19:36:00548 INIT_FUNC(CryptohomeMountGuest);
Frank Swiderskic317de62010-08-31 18:08:58549 INIT_FUNC(CryptohomeAsyncMountGuest);
Chris Masonee9d48f22010-03-08 19:18:58550 INIT_FUNC(CryptohomeUnmount);
Frank Swiderski692b1dd2010-09-27 22:46:46551 INIT_FUNC(CryptohomeRemoveTrackedSubdirectories);
552 INIT_FUNC(CryptohomeAsyncRemoveTrackedSubdirectories);
Denis Glotova7f3eec2011-03-04 15:11:38553 INIT_FUNC(CryptohomeDoAutomaticFreeDiskSpaceControl);
554 INIT_FUNC(CryptohomeAsyncDoAutomaticFreeDiskSpaceControl);
Denis Glotov4f3db482011-04-20 16:35:57555 INIT_FUNC(CryptohomeAsyncSetOwnerUser);
Frank Swiderski6e238ab2010-08-06 20:37:06556 INIT_FUNC(CryptohomeTpmIsReady);
557 INIT_FUNC(CryptohomeTpmIsEnabled);
Frank Swiderskidf0f40d2010-09-01 22:43:08558 INIT_FUNC(CryptohomeTpmIsOwned);
559 INIT_FUNC(CryptohomeTpmIsBeingOwned);
Frank Swiderski6e238ab2010-08-06 20:37:06560 INIT_FUNC(CryptohomeTpmGetPassword);
Frank Swiderski880db712011-01-18 21:46:33561 INIT_FUNC(CryptohomeTpmGetPasswordSafe);
Frank Swiderski39281852010-10-04 22:16:28562 INIT_FUNC(CryptohomeTpmCanAttemptOwnership);
563 INIT_FUNC(CryptohomeTpmClearStoredPassword);
Ken Mixter77ef50e2011-04-12 20:36:41564 INIT_FUNC(CryptohomePkcs11IsTpmTokenReady);
565 INIT_FUNC(CryptohomePkcs11GetTpmTokenInfo);
Frank Swiderskidf0f40d2010-09-01 22:43:08566 INIT_FUNC(CryptohomeGetStatusString);
Frank Swiderski880db712011-01-18 21:46:33567 INIT_FUNC(CryptohomeGetStatusStringSafe);
Julian Pastarmov1081ddb2011-04-15 12:19:38568 INIT_FUNC(CryptohomeInstallAttributesGet);
569 INIT_FUNC(CryptohomeInstallAttributesSet);
570 INIT_FUNC(CryptohomeInstallAttributesCount);
571 INIT_FUNC(CryptohomeInstallAttributesFinalize);
572 INIT_FUNC(CryptohomeInstallAttributesIsReady);
573 INIT_FUNC(CryptohomeInstallAttributesIsSecure);
574 INIT_FUNC(CryptohomeInstallAttributesIsInvalid);
575 INIT_FUNC(CryptohomeInstallAttributesIsFirstInstall);
576
Frank Swiderski880db712011-01-18 21:46:33577 INIT_FUNC(CryptohomeFreeString);
578 INIT_FUNC(CryptohomeFreeBlob);
Frank Swiderskic317de62010-08-31 18:08:58579 INIT_FUNC(CryptohomeMonitorSession);
580 INIT_FUNC(CryptohomeDisconnectSession);
Chris Masonee9d48f22010-03-08 19:18:58581
Toni Barzica4a45a32010-08-20 21:01:57582 // Imageburn
583 INIT_FUNC(MonitorBurnStatus);
584 INIT_FUNC(DisconnectBurnStatus);
585 INIT_FUNC(StartBurn);
tbarzic160d7952011-05-14 02:15:40586 INIT_FUNC(RequestBurn);
Chris Masonecc58f462010-08-20 23:53:00587
Andrew de los Reyes9fe15e82010-06-07 23:41:54588 // Update Engine
589 INIT_FUNC(MonitorUpdateStatus);
590 INIT_FUNC(DisconnectUpdateProgress);
591 INIT_FUNC(RetrieveUpdateProgress);
592 INIT_FUNC(InitiateUpdateCheck);
Darin Petkov69c5c262010-07-27 18:05:55593 INIT_FUNC(RebootIfUpdated);
Satoru Takabayashi9d2a2872010-10-27 04:49:08594 INIT_FUNC(SetTrack);
595 INIT_FUNC(GetTrack);
James Cook8cab7202011-05-09 17:42:46596 INIT_FUNC(RequestUpdateStatus);
Steven Bennetts82fea482011-03-16 16:57:15597 INIT_FUNC(RequestUpdateCheck);
598 INIT_FUNC(SetUpdateTrack);
599 INIT_FUNC(RequestUpdateTrack);
rspangler@google.comabb66d22009-10-10 00:23:49600
Satoru Takabayashi9d2a2872010-10-27 04:49:08601 // Speech Synthesis
Chaitanya Gharpure8b422582010-04-21 23:54:20602 INIT_FUNC(Speak);
603 INIT_FUNC(SetSpeakProperties);
604 INIT_FUNC(StopSpeaking);
605 INIT_FUNC(IsSpeaking);
Chaitanya Gharpure8d763fc2010-06-08 17:38:31606 INIT_FUNC(InitTts);
Chaitanya Gharpure8b422582010-04-21 23:54:20607
Daniel Erat7537f1e2010-12-07 22:00:16608 // Brightness
Chris Wolfec8b0c122011-05-02 20:35:04609 INIT_FUNC(DecreaseScreenBrightness);
610 INIT_FUNC(IncreaseScreenBrightness);
Daniel Eratccea53b2011-03-11 21:39:31611 INIT_FUNC(MonitorBrightnessV2);
Daniel Erat7537f1e2010-12-07 22:00:16612 INIT_FUNC(MonitorBrightness);
613 INIT_FUNC(DisconnectBrightness);
614
Kuan Tan9fb4a742011-01-27 22:03:10615 // LibCros Service
616 INIT_FUNC(StartLibCrosService);
617 INIT_FUNC(StopLibCrosService);
618 INIT_FUNC(SetNetworkProxyResolver);
619 INIT_FUNC(NotifyNetworkProxyResolved);
620
David Moore363c95e2010-02-23 00:41:34621 return error_string.empty();
rspangler@google.comabb66d22009-10-10 00:23:49622}
623
Steven Bennetts11ac0492011-02-24 23:01:15624void SetLibcrosTimeHistogramFunction(LibcrosTimeHistogramFunc func) {
625 addHistogram = func;
626}
627
rspangler@google.comabb66d22009-10-10 00:23:49628} // namespace chromeos