Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: chrome_frame/ready_mode/internal/registry_ready_mode_state.cc

Issue 90963002: Revert of Base: Remove Receive() from ScopedHandle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/ui/ui_test_suite.cc ('k') | chrome_frame/test/chrome_frame_test_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/launch.h" 10 #include "base/process/launch.h"
(...skipping 22 matching lines...) Expand all
33 33
34 HKEY roots[] = {HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE}; 34 HKEY roots[] = {HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE};
35 35
36 for (int i = 0; i < arraysize(roots); i++) { 36 for (int i = 0; i < arraysize(roots); i++) {
37 base::win::RegKey version_key; 37 base::win::RegKey version_key;
38 if (version_key.Open(roots[i], version_key_name.c_str(), 38 if (version_key.Open(roots[i], version_key_name.c_str(),
39 KEY_QUERY_VALUE) == ERROR_SUCCESS) { 39 KEY_QUERY_VALUE) == ERROR_SUCCESS) {
40 std::wstring command_line; 40 std::wstring command_line;
41 if (version_key.ReadValue(command_field.c_str(), 41 if (version_key.ReadValue(command_field.c_str(),
42 &command_line) == ERROR_SUCCESS) { 42 &command_line) == ERROR_SUCCESS) {
43 base::win::ScopedHandle launched_process; 43 HANDLE launched_process = NULL;
44 base::LaunchOptions options; 44 base::LaunchOptions options;
45 options.start_hidden = true; 45 options.start_hidden = true;
46 if (base::LaunchProcess(command_line, options, &launched_process)) { 46 if (base::LaunchProcess(command_line, options, &launched_process)) {
47 return launched_process.Take(); 47 return launched_process;
48 } 48 }
49 } 49 }
50 } 50 }
51 } 51 }
52 return NULL; 52 return NULL;
53 } 53 }
54 54
55 // Attempts to launch a command using the ProcessLauncher. Returns a handle to 55 // Attempts to launch a command using the ProcessLauncher. Returns a handle to
56 // the launched process, which the caller is responsible for closing, or NULL 56 // the launched process, which the caller is responsible for closing, or NULL
57 // upon failure. 57 // upon failure.
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 void RegistryReadyModeState::PermanentlyDeclineChromeFrame() { 246 void RegistryReadyModeState::PermanentlyDeclineChromeFrame() {
247 if (LaunchAndCheckCommand(google_update::kRegCFOptOutCmdField)) 247 if (LaunchAndCheckCommand(google_update::kRegCFOptOutCmdField))
248 RefreshStateAndNotify(); 248 RefreshStateAndNotify();
249 } 249 }
250 250
251 void RegistryReadyModeState::AcceptChromeFrame() { 251 void RegistryReadyModeState::AcceptChromeFrame() {
252 if (LaunchAndCheckCommand(google_update::kRegCFOptInCmdField)) 252 if (LaunchAndCheckCommand(google_update::kRegCFOptInCmdField))
253 NotifyObserver(); 253 NotifyObserver();
254 } 254 }
OLDNEW
« no previous file with comments | « chrome/test/ui/ui_test_suite.cc ('k') | chrome_frame/test/chrome_frame_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698