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 // See the corresponding header file for description of the functions in this | 5 // See the corresponding header file for description of the functions in this |
6 // file. | 6 // file. |
7 | 7 |
8 #include "chrome/installer/util/install_util.h" | 8 #include "chrome/installer/util/install_util.h" |
9 | 9 |
10 #include <shellapi.h> | 10 #include <shellapi.h> |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 CommandLine::StringType params(cmd.GetCommandLineString()); | 166 CommandLine::StringType params(cmd.GetCommandLineString()); |
167 if (params[0] == '"') { | 167 if (params[0] == '"') { |
168 DCHECK_EQ('"', params[program.length() + 1]); | 168 DCHECK_EQ('"', params[program.length() + 1]); |
169 DCHECK_EQ(program, params.substr(1, program.length())); | 169 DCHECK_EQ(program, params.substr(1, program.length())); |
170 params = params.substr(program.length() + 2); | 170 params = params.substr(program.length() + 2); |
171 } else { | 171 } else { |
172 DCHECK_EQ(program, params.substr(0, program.length())); | 172 DCHECK_EQ(program, params.substr(0, program.length())); |
173 params = params.substr(program.length()); | 173 params = params.substr(program.length()); |
174 } | 174 } |
175 | 175 |
176 TrimWhitespace(params, TRIM_ALL, ¶ms); | 176 base::TrimWhitespace(params, base::TRIM_ALL, ¶ms); |
177 | 177 |
178 HWND uac_foreground_window = CreateUACForegroundWindow(); | 178 HWND uac_foreground_window = CreateUACForegroundWindow(); |
179 | 179 |
180 SHELLEXECUTEINFO info = {0}; | 180 SHELLEXECUTEINFO info = {0}; |
181 info.cbSize = sizeof(SHELLEXECUTEINFO); | 181 info.cbSize = sizeof(SHELLEXECUTEINFO); |
182 info.fMask = SEE_MASK_NOCLOSEPROCESS; | 182 info.fMask = SEE_MASK_NOCLOSEPROCESS; |
183 info.hwnd = uac_foreground_window; | 183 info.hwnd = uac_foreground_window; |
184 info.lpVerb = L"runas"; | 184 info.lpVerb = L"runas"; |
185 info.lpFile = program.c_str(); | 185 info.lpFile = program.c_str(); |
186 info.lpParameters = params.c_str(); | 186 info.lpParameters = params.c_str(); |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 // Open the program and see if it references the expected file. | 599 // Open the program and see if it references the expected file. |
600 base::File file; | 600 base::File file; |
601 BY_HANDLE_FILE_INFORMATION info = {}; | 601 BY_HANDLE_FILE_INFORMATION info = {}; |
602 | 602 |
603 return (OpenForInfo(path, &file) && | 603 return (OpenForInfo(path, &file) && |
604 GetInfo(file, &info) && | 604 GetInfo(file, &info) && |
605 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && | 605 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && |
606 info.nFileIndexHigh == file_info_.nFileIndexHigh && | 606 info.nFileIndexHigh == file_info_.nFileIndexHigh && |
607 info.nFileIndexLow == file_info_.nFileIndexLow); | 607 info.nFileIndexLow == file_info_.nFileIndexLow); |
608 } | 608 } |
OLD | NEW |