| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 return NULL; | 53 return NULL; |
| 54 } | 54 } |
| 55 | 55 |
| 56 // Attempts to launch a command using the ProcessLauncher. Returns a handle to | 56 // Attempts to launch a command using the ProcessLauncher. Returns a handle to |
| 57 // the launched process, which the caller is responsible for closing, or NULL | 57 // the launched process, which the caller is responsible for closing, or NULL |
| 58 // upon failure. | 58 // upon failure. |
| 59 HANDLE LaunchCommandViaProcessLauncher(const std::wstring& command_field) { | 59 HANDLE LaunchCommandViaProcessLauncher(const std::wstring& command_field) { |
| 60 HANDLE launched_process = NULL; | 60 HANDLE launched_process = NULL; |
| 61 | 61 |
| 62 scoped_ptr<CommandLine> command_line( | 62 scoped_ptr<CommandLine> command_line; |
| 63 chrome_launcher::CreateUpdateCommandLine(command_field)); | 63 if (chrome_launcher::CreateUpdateCommandLine(command_field, &command_line)) { |
| 64 | 64 DCHECK(command_line != NULL); |
| 65 if (command_line != NULL) { | |
| 66 base::LaunchOptions options; | 65 base::LaunchOptions options; |
| 67 options.start_hidden = true; | 66 options.start_hidden = true; |
| 68 base::LaunchProcess(*command_line, options, &launched_process); | 67 base::LaunchProcess(*command_line, options, &launched_process); |
| 69 } | 68 } |
| 70 | 69 |
| 71 return launched_process; | 70 return launched_process; |
| 72 } | 71 } |
| 73 | 72 |
| 74 // Waits for the provided process to exit, and verifies that its exit code | 73 // Waits for the provided process to exit, and verifies that its exit code |
| 75 // corresponds to one of the known "success" codes for the installer. If the | 74 // corresponds to one of the known "success" codes for the installer. If the |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 246 |
| 248 void RegistryReadyModeState::PermanentlyDeclineChromeFrame() { | 247 void RegistryReadyModeState::PermanentlyDeclineChromeFrame() { |
| 249 if (LaunchAndCheckCommand(google_update::kRegCFOptOutCmdField)) | 248 if (LaunchAndCheckCommand(google_update::kRegCFOptOutCmdField)) |
| 250 RefreshStateAndNotify(); | 249 RefreshStateAndNotify(); |
| 251 } | 250 } |
| 252 | 251 |
| 253 void RegistryReadyModeState::AcceptChromeFrame() { | 252 void RegistryReadyModeState::AcceptChromeFrame() { |
| 254 if (LaunchAndCheckCommand(google_update::kRegCFOptInCmdField)) | 253 if (LaunchAndCheckCommand(google_update::kRegCFOptInCmdField)) |
| 255 NotifyObserver(); | 254 NotifyObserver(); |
| 256 } | 255 } |
| OLD | NEW |