OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 302 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
303 HKEY reg_root = InstallUtil::IsPerUserInstall(chrome_exe.c_str()) ? | 303 HKEY reg_root = InstallUtil::IsPerUserInstall(chrome_exe.c_str()) ? |
304 HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; | 304 HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; |
305 RegKey key(reg_root, dist->GetUninstallRegPath().c_str()); | 305 RegKey key(reg_root, dist->GetUninstallRegPath().c_str()); |
306 key.ReadValue(installer_util::kUninstallStringField, &exe_path); | 306 key.ReadValue(installer_util::kUninstallStringField, &exe_path); |
307 CommandLine command_line = CommandLine::FromString(exe_path); | 307 CommandLine command_line = CommandLine::FromString(exe_path); |
308 exe_path = command_line.program(); | 308 exe_path = command_line.program(); |
309 } | 309 } |
310 if (file_util::PathExists(FilePath::FromWStringHack(exe_path))) { | 310 if (file_util::PathExists(FilePath::FromWStringHack(exe_path))) { |
311 std::wstring params(L"--"); | 311 std::wstring params(L"--"); |
312 params.append(installer_util::switches::kRegisterChromeBrowser); | 312 params.append( |
| 313 ASCIIToWide(installer_util::switches::kRegisterChromeBrowser)); |
313 params.append(L"=\"" + chrome_exe + L"\""); | 314 params.append(L"=\"" + chrome_exe + L"\""); |
314 if (!suffix.empty()) { | 315 if (!suffix.empty()) { |
315 params.append(L" --"); | 316 params.append(L" --"); |
316 params.append(installer_util::switches::kRegisterChromeBrowserSuffix); | 317 params.append(ASCIIToWide( |
| 318 installer_util::switches::kRegisterChromeBrowserSuffix)); |
317 params.append(L"=\"" + suffix + L"\""); | 319 params.append(L"=\"" + suffix + L"\""); |
318 } | 320 } |
319 | 321 |
320 CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 322 CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
321 if (browser_command_line.HasSwitch(switches::kChromeFrame)) { | 323 if (browser_command_line.HasSwitch(switches::kChromeFrame)) { |
322 params.append(L" --"); | 324 params.append(L" --"); |
323 params.append(installer_util::switches::kChromeFrame); | 325 params.append(installer_util::switches::kChromeFrame); |
324 } | 326 } |
325 | 327 |
326 DWORD ret_val = 0; | 328 DWORD ret_val = 0; |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 chrome_exe.c_str(), // target | 796 chrome_exe.c_str(), // target |
795 shortcut.c_str(), // shortcut | 797 shortcut.c_str(), // shortcut |
796 chrome_path.c_str(), // working dir | 798 chrome_path.c_str(), // working dir |
797 NULL, // arguments | 799 NULL, // arguments |
798 description.c_str(), // description | 800 description.c_str(), // description |
799 chrome_exe.c_str(), // icon file | 801 chrome_exe.c_str(), // icon file |
800 icon_index, // icon index | 802 icon_index, // icon index |
801 dist->GetBrowserAppId().c_str()); // app id | 803 dist->GetBrowserAppId().c_str()); // app id |
802 } | 804 } |
803 } | 805 } |
OLD | NEW |