OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // This file defines functions that integrate Chrome in Windows shell. These | 5 // This file defines functions that integrate Chrome in Windows shell. These |
6 // functions can be used by Chrome as well as Chrome installer. All of the | 6 // functions can be used by Chrome as well as Chrome installer. All of the |
7 // work is done by the local functions defined in anonymous namespace in | 7 // work is done by the local functions defined in anonymous namespace in |
8 // this class. | 8 // this class. |
9 | 9 |
10 #include "chrome/installer/util/shell_util.h" | 10 #include "chrome/installer/util/shell_util.h" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 } | 306 } |
307 if (file_util::PathExists(FilePath::FromWStringHack(exe_path))) { | 307 if (file_util::PathExists(FilePath::FromWStringHack(exe_path))) { |
308 std::wstring params(L"--"); | 308 std::wstring params(L"--"); |
309 params.append(installer_util::switches::kRegisterChromeBrowser); | 309 params.append(installer_util::switches::kRegisterChromeBrowser); |
310 params.append(L"=\"" + chrome_exe + L"\""); | 310 params.append(L"=\"" + chrome_exe + L"\""); |
311 if (!suffix.empty()) { | 311 if (!suffix.empty()) { |
312 params.append(L" --"); | 312 params.append(L" --"); |
313 params.append(installer_util::switches::kRegisterChromeBrowserSuffix); | 313 params.append(installer_util::switches::kRegisterChromeBrowserSuffix); |
314 params.append(L"=\"" + suffix + L"\""); | 314 params.append(L"=\"" + suffix + L"\""); |
315 } | 315 } |
| 316 |
| 317 CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
| 318 if (browser_command_line.HasSwitch(switches::kChromeFrame)) { |
| 319 params.append(L" --"); |
| 320 params.append(installer_util::switches::kChromeFrame); |
| 321 } |
| 322 |
316 DWORD ret_val = 0; | 323 DWORD ret_val = 0; |
317 InstallUtil::ExecuteExeAsAdmin(exe_path, params, &ret_val); | 324 InstallUtil::ExecuteExeAsAdmin(exe_path, params, &ret_val); |
318 if (ret_val == 0) | 325 if (ret_val == 0) |
319 return true; | 326 return true; |
320 } | 327 } |
321 return false; | 328 return false; |
322 } | 329 } |
323 | 330 |
324 // This method tries to figure out if another user has already registered her | 331 // This method tries to figure out if another user has already registered her |
325 // own copy of Chrome so that we can avoid overwriting it and append current | 332 // own copy of Chrome so that we can avoid overwriting it and append current |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 } else { | 778 } else { |
772 return file_util::UpdateShortcutLink(chrome_exe.c_str(), // target | 779 return file_util::UpdateShortcutLink(chrome_exe.c_str(), // target |
773 shortcut.c_str(), // shortcut | 780 shortcut.c_str(), // shortcut |
774 chrome_path.c_str(), // working dir | 781 chrome_path.c_str(), // working dir |
775 NULL, // arguments | 782 NULL, // arguments |
776 description.c_str(), // description | 783 description.c_str(), // description |
777 chrome_exe.c_str(), // icon file | 784 chrome_exe.c_str(), // icon file |
778 0); // icon index | 785 0); // icon index |
779 } | 786 } |
780 } | 787 } |
OLD | NEW |