| 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 // 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 return foreground_window; | 111 return foreground_window; |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace | 114 } // namespace |
| 115 | 115 |
| 116 bool InstallUtil::ExecuteExeAsAdmin(const CommandLine& cmd, DWORD* exit_code) { | 116 bool InstallUtil::ExecuteExeAsAdmin(const CommandLine& cmd, DWORD* exit_code) { |
| 117 FilePath::StringType program(cmd.GetProgram().value()); | 117 FilePath::StringType program(cmd.GetProgram().value()); |
| 118 DCHECK(!program.empty()); | 118 DCHECK(!program.empty()); |
| 119 DCHECK_NE(program[0], L'\"'); | 119 DCHECK_NE(program[0], L'\"'); |
| 120 | 120 |
| 121 CommandLine::StringType params(cmd.command_line_string()); | 121 CommandLine::StringType params(cmd.GetCommandLineString()); |
| 122 if (params[0] == '"') { | 122 if (params[0] == '"') { |
| 123 DCHECK_EQ('"', params[program.length() + 1]); | 123 DCHECK_EQ('"', params[program.length() + 1]); |
| 124 DCHECK_EQ(program, params.substr(1, program.length())); | 124 DCHECK_EQ(program, params.substr(1, program.length())); |
| 125 params = params.substr(program.length() + 2); | 125 params = params.substr(program.length() + 2); |
| 126 } else { | 126 } else { |
| 127 DCHECK_EQ(program, params.substr(0, program.length())); | 127 DCHECK_EQ(program, params.substr(0, program.length())); |
| 128 params = params.substr(program.length()); | 128 params = params.substr(program.length()); |
| 129 } | 129 } |
| 130 | 130 |
| 131 TrimWhitespace(params, TRIM_ALL, ¶ms); | 131 TrimWhitespace(params, TRIM_ALL, ¶ms); |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 int len = GetDateFormatW(LOCALE_INVARIANT, 0, NULL, kDateFormat, | 437 int len = GetDateFormatW(LOCALE_INVARIANT, 0, NULL, kDateFormat, |
| 438 date_str, arraysize(date_str)); | 438 date_str, arraysize(date_str)); |
| 439 if (len) { | 439 if (len) { |
| 440 --len; // Subtract terminating \0. | 440 --len; // Subtract terminating \0. |
| 441 } else { | 441 } else { |
| 442 PLOG(DFATAL) << "GetDateFormat"; | 442 PLOG(DFATAL) << "GetDateFormat"; |
| 443 } | 443 } |
| 444 | 444 |
| 445 return std::wstring(date_str, len); | 445 return std::wstring(date_str, len); |
| 446 } | 446 } |
| OLD | NEW |