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, dist->GetUninstallRegPath().c_str(), KEY_READ); | 715 RegKey key(reg_root, |
| 716 dist->GetUninstallRegPath().c_str(), |
| 717 KEY_READ | KEY_WOW64_32KEY); |
716 base::string16 uninstall_string; | 718 base::string16 uninstall_string; |
717 key.ReadValue(installer::kUninstallStringField, &uninstall_string); | 719 key.ReadValue(installer::kUninstallStringField, &uninstall_string); |
718 CommandLine command_line = CommandLine::FromString(uninstall_string); | 720 CommandLine command_line = CommandLine::FromString(uninstall_string); |
719 exe_path = command_line.GetProgram(); | 721 exe_path = command_line.GetProgram(); |
720 } | 722 } |
721 | 723 |
722 if (base::PathExists(exe_path)) { | 724 if (base::PathExists(exe_path)) { |
723 CommandLine cmd(exe_path); | 725 CommandLine cmd(exe_path); |
724 cmd.AppendSwitchNative(installer::switches::kRegisterChromeBrowser, | 726 cmd.AppendSwitchNative(installer::switches::kRegisterChromeBrowser, |
725 chrome_exe); | 727 chrome_exe); |
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2268 // are any left...). | 2270 // are any left...). |
2269 if (free_bits >= 8 && next_byte_index < size) { | 2271 if (free_bits >= 8 && next_byte_index < size) { |
2270 free_bits -= 8; | 2272 free_bits -= 8; |
2271 bit_stream += bytes[next_byte_index++] << free_bits; | 2273 bit_stream += bytes[next_byte_index++] << free_bits; |
2272 } | 2274 } |
2273 } | 2275 } |
2274 | 2276 |
2275 DCHECK_EQ(ret.length(), encoded_length); | 2277 DCHECK_EQ(ret.length(), encoded_length); |
2276 return ret; | 2278 return ret; |
2277 } | 2279 } |
OLD | NEW |