OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/host/plugin/daemon_installer_win.h" | 5 #include "remoting/host/plugin/daemon_installer_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 // Get the full path to GoogleUpdate.exe from the registry. | 278 // Get the full path to GoogleUpdate.exe from the registry. |
279 base::win::RegKey update_key; | 279 base::win::RegKey update_key; |
280 LONG result = update_key.Open(HKEY_CURRENT_USER, | 280 LONG result = update_key.Open(HKEY_CURRENT_USER, |
281 kOmahaUpdateKeyName, | 281 kOmahaUpdateKeyName, |
282 KEY_READ); | 282 KEY_READ); |
283 if (result != ERROR_SUCCESS) { | 283 if (result != ERROR_SUCCESS) { |
284 Done(HRESULT_FROM_WIN32(result)); | 284 Done(HRESULT_FROM_WIN32(result)); |
285 return; | 285 return; |
286 } | 286 } |
287 | 287 |
| 288 // presubmit: allow wstring |
288 std::wstring google_update; | 289 std::wstring google_update; |
289 result = update_key.ReadValue(kOmahaPathValueName, | 290 result = update_key.ReadValue(kOmahaPathValueName, &google_update); |
290 &google_update); | |
291 if (result != ERROR_SUCCESS) { | 291 if (result != ERROR_SUCCESS) { |
292 Done(HRESULT_FROM_WIN32(result)); | 292 Done(HRESULT_FROM_WIN32(result)); |
293 return; | 293 return; |
294 } | 294 } |
295 | 295 |
296 // Launch the updater process and wait for its termination. | 296 // Launch the updater process and wait for its termination. |
297 std::wstring command_line = | 297 string16 command_line = WideToUTF16( |
298 StringPrintf(kGoogleUpdateCommandLineFormat, | 298 StringPrintf(kGoogleUpdateCommandLineFormat, |
299 google_update.c_str(), | 299 google_update.c_str(), |
300 kHostOmahaAppid, | 300 kHostOmahaAppid, |
301 kOmahaLanguage); | 301 kOmahaLanguage)); |
302 | 302 |
303 base::LaunchOptions options; | 303 base::LaunchOptions options; |
304 if (!base::LaunchProcess(WideToUTF16(command_line), options, | 304 if (!base::LaunchProcess(command_line, options, process_.Receive())) { |
305 process_.Receive())) { | |
306 result = GetLastError(); | 305 result = GetLastError(); |
307 Done(HRESULT_FROM_WIN32(result)); | 306 Done(HRESULT_FROM_WIN32(result)); |
308 return; | 307 return; |
309 } | 308 } |
310 | 309 |
311 if (!process_watcher_.StartWatching(process_.Get(), this)) { | 310 if (!process_watcher_.StartWatching(process_.Get(), this)) { |
312 result = GetLastError(); | 311 result = GetLastError(); |
313 Done(HRESULT_FROM_WIN32(result)); | 312 Done(HRESULT_FROM_WIN32(result)); |
314 return; | 313 return; |
315 } | 314 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 HWND parent = GetAncestor(window, GA_PARENT); | 400 HWND parent = GetAncestor(window, GA_PARENT); |
402 if (parent == NULL) { | 401 if (parent == NULL) { |
403 return window; | 402 return window; |
404 } | 403 } |
405 | 404 |
406 window = parent; | 405 window = parent; |
407 } | 406 } |
408 } | 407 } |
409 | 408 |
410 } // namespace remoting | 409 } // namespace remoting |
OLD | NEW |