| 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 // 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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 const base::string16& protocol) { | 705 const base::string16& protocol) { |
| 706 // Only user-level installs prior to Windows 8 should need to elevate to | 706 // Only user-level installs prior to Windows 8 should need to elevate to |
| 707 // register. | 707 // register. |
| 708 DCHECK(InstallUtil::IsPerUserInstall(chrome_exe.c_str())); | 708 DCHECK(InstallUtil::IsPerUserInstall(chrome_exe.c_str())); |
| 709 DCHECK_LT(base::win::GetVersion(), base::win::VERSION_WIN8); | 709 DCHECK_LT(base::win::GetVersion(), base::win::VERSION_WIN8); |
| 710 base::FilePath exe_path = | 710 base::FilePath exe_path = |
| 711 base::FilePath(chrome_exe).DirName().Append(installer::kSetupExe); | 711 base::FilePath(chrome_exe).DirName().Append(installer::kSetupExe); |
| 712 if (!base::PathExists(exe_path)) { | 712 if (!base::PathExists(exe_path)) { |
| 713 HKEY reg_root = InstallUtil::IsPerUserInstall(chrome_exe.c_str()) ? | 713 HKEY reg_root = InstallUtil::IsPerUserInstall(chrome_exe.c_str()) ? |
| 714 HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; | 714 HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; |
| 715 RegKey key(reg_root, | 715 RegKey key(reg_root, dist->GetUninstallRegPath().c_str(), KEY_READ); |
| 716 dist->GetUninstallRegPath().c_str(), | |
| 717 KEY_READ | KEY_WOW64_32KEY); | |
| 718 base::string16 uninstall_string; | 716 base::string16 uninstall_string; |
| 719 key.ReadValue(installer::kUninstallStringField, &uninstall_string); | 717 key.ReadValue(installer::kUninstallStringField, &uninstall_string); |
| 720 CommandLine command_line = CommandLine::FromString(uninstall_string); | 718 CommandLine command_line = CommandLine::FromString(uninstall_string); |
| 721 exe_path = command_line.GetProgram(); | 719 exe_path = command_line.GetProgram(); |
| 722 } | 720 } |
| 723 | 721 |
| 724 if (base::PathExists(exe_path)) { | 722 if (base::PathExists(exe_path)) { |
| 725 CommandLine cmd(exe_path); | 723 CommandLine cmd(exe_path); |
| 726 cmd.AppendSwitchNative(installer::switches::kRegisterChromeBrowser, | 724 cmd.AppendSwitchNative(installer::switches::kRegisterChromeBrowser, |
| 727 chrome_exe); | 725 chrome_exe); |
| (...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2270 // are any left...). | 2268 // are any left...). |
| 2271 if (free_bits >= 8 && next_byte_index < size) { | 2269 if (free_bits >= 8 && next_byte_index < size) { |
| 2272 free_bits -= 8; | 2270 free_bits -= 8; |
| 2273 bit_stream += bytes[next_byte_index++] << free_bits; | 2271 bit_stream += bytes[next_byte_index++] << free_bits; |
| 2274 } | 2272 } |
| 2275 } | 2273 } |
| 2276 | 2274 |
| 2277 DCHECK_EQ(ret.length(), encoded_length); | 2275 DCHECK_EQ(ret.length(), encoded_length); |
| 2278 return ret; | 2276 return ret; |
| 2279 } | 2277 } |
| OLD | NEW |