Chromium Code Reviews| Index: cloud_print/virtual_driver/win/port_monitor/port_monitor.cc |
| diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc |
| index 562d0b8dea617b4b4ac3d32929d46b3c981eccd7..c6f1688fd2ef3759864f6751022e1772ae1ee971 100644 |
| --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc |
| +++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc |
| @@ -380,6 +380,16 @@ BOOL WINAPI Monitor2StartDocPort(HANDLE port_handle, |
| DWORD, |
| BYTE*) { |
| LOG(INFO) << "Monitor2StartDocPort"; |
| + const wchar_t* kUsageKey = L"dr"; |
| + // Set appropriate key to 1 to let Omaha record usage. |
| + base::win::RegKey key; |
| + if (key.Create(HKEY_CURRENT_USER, kKeyLocation, |
| + KEY_ALL_ACCESS) != ERROR_SUCCESS) { |
|
sanjeevr
2011/08/03 11:19:29
You only need KEY_SET_VALUE.
abeera
2011/08/03 19:50:30
Done.
|
| + LOG(ERROR) << "Unable to open key to log usage"; |
| + } |
| + if (key.WriteValue(kUsageKey, L"1") != ERROR_SUCCESS) { |
| + LOG(ERROR) << "Unable to set usage key"; |
| + } |
| if (port_handle == NULL) { |
| LOG(ERROR) << "port_handle should not be NULL."; |
| SetLastError(ERROR_INVALID_PARAMETER); |