OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome_frame/ready_mode/internal/registry_ready_mode_state.h" | 5 #include "chrome_frame/ready_mode/internal/registry_ready_mode_state.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // upon failure. | 55 // upon failure. |
56 HANDLE LaunchCommandViaProcessLauncher(const std::wstring& command_field) { | 56 HANDLE LaunchCommandViaProcessLauncher(const std::wstring& command_field) { |
57 HANDLE launched_process = NULL; | 57 HANDLE launched_process = NULL; |
58 | 58 |
59 scoped_ptr<CommandLine> command_line( | 59 scoped_ptr<CommandLine> command_line( |
60 chrome_launcher::CreateUpdateCommandLine(command_field)); | 60 chrome_launcher::CreateUpdateCommandLine(command_field)); |
61 | 61 |
62 if (command_line != NULL) { | 62 if (command_line != NULL) { |
63 base::LaunchOptions options; | 63 base::LaunchOptions options; |
64 options.start_hidden = true; | 64 options.start_hidden = true; |
65 options.process_handle = &launched_process; | 65 base::LaunchProcess(*command_line, options, &launched_process); |
66 base::LaunchProcess(*command_line, options); | |
67 } | 66 } |
68 | 67 |
69 return launched_process; | 68 return launched_process; |
70 } | 69 } |
71 | 70 |
72 // Waits for the provided process to exit, and verifies that its exit code | 71 // Waits for the provided process to exit, and verifies that its exit code |
73 // corresponds to one of the known "success" codes for the installer. If the | 72 // corresponds to one of the known "success" codes for the installer. If the |
74 // exit code cannot be retrieved, or if it signals failure, returns false. | 73 // exit code cannot be retrieved, or if it signals failure, returns false. |
75 bool CheckProcessExitCode(HANDLE handle) { | 74 bool CheckProcessExitCode(HANDLE handle) { |
76 // TODO(erikwright): Use RegisterWaitForSingleObject to wait | 75 // TODO(erikwright): Use RegisterWaitForSingleObject to wait |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 244 |
246 void RegistryReadyModeState::PermanentlyDeclineChromeFrame() { | 245 void RegistryReadyModeState::PermanentlyDeclineChromeFrame() { |
247 if (LaunchAndCheckCommand(google_update::kRegCFOptOutCmdField)) | 246 if (LaunchAndCheckCommand(google_update::kRegCFOptOutCmdField)) |
248 RefreshStateAndNotify(); | 247 RefreshStateAndNotify(); |
249 } | 248 } |
250 | 249 |
251 void RegistryReadyModeState::AcceptChromeFrame() { | 250 void RegistryReadyModeState::AcceptChromeFrame() { |
252 if (LaunchAndCheckCommand(google_update::kRegCFOptInCmdField)) | 251 if (LaunchAndCheckCommand(google_update::kRegCFOptInCmdField)) |
253 NotifyObserver(); | 252 NotifyObserver(); |
254 } | 253 } |
OLD | NEW |